behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

[request] Adding accessor to b2Fixture for "m_aabb". #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After performing a world-query and given the returned fixture-set I'd like
to perform a further check to cull fixtures that are not completely
encapsulated by the AABB. To do this quickly, I'd like to gain access to
the fixtures' AABB.

Therefore it would be very handy to be able to gain read-access to the
synchronized AABB for a fixture directly with something like:

inline const b2AABB& b2Fixture::getAABB( void ) const
{
    return m_aabb;
}

I have made this modification but it'd be great to have it in the trunk.

Thanks in advance!

Original issue reported on code.google.com by melv....@gmail.com on 18 Aug 2009 at 6:46

GoogleCodeExporter commented 9 years ago
I need to think about this. There may be places where you access the fixture 
where the 
AABB is old and wrong.

Original comment by erinca...@gmail.com on 24 Aug 2009 at 7:49

GoogleCodeExporter commented 9 years ago
Instead you should access the shape and compute a fresh AABB. This will 
guarantee that 
you get the correct AABB, assuming you supply the correct transform.

Original comment by erinca...@gmail.com on 19 Sep 2009 at 8:11