madmik3
madmik3

Reputation: 6973

detect collisions before b2Body created in world

I am new to Box2d in coscos2d. I would like to detect if a b2Body will collide with objects in my world prior to insertion. Is there an easy way to do this?

thanks!

Upvotes: 0

Views: 95

Answers (1)

Andrew
Andrew

Reputation: 24846

You can use b2QueryCallback to test if some AABB (defined by you) overlaps with currently existing bodies in 'b2World'. You can create an AABB coinciding with the AABB of your new body you want to add to the world

Upvotes: 1

Related Questions