In Box2D, I was curious if it's possible to get a bounding box of a body already created in the world.
So basically, the Body is created, it's interacting with the world and such. And I needed that Body's bounding box. Is it possible?
|
In Box2D, I was curious if it's possible to get a bounding box of a body already created in the world. So basically, the Body is created, it's interacting with the world and such. And I needed that Body's bounding box. Is it possible? |
||||
|
|
|
In Box2D, bodies don't have bounding boxes associated with them, fixture do. So you need to iterate over all the fixtures and generate a new AABB. Something like this:
|
|||||||
|