What would be the easiest (and fastest) way to get the bodies in an AABB?
The size of the AABB will vary and the number of times it is called per frame will too (some frames no checks are needed, other frames many checks are needed).
I am looking at using btGhostObject, but then I would have to resize the shape before every check and I am guessing this can be expensive?
Would be very grateful if anybody could point me in the right direction!
Get bodies in AABB
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Get bodies in AABB
You could try using the btDbvtBroadphase, and use the btBroadphaseInterface::aabbTest query and implement your derived class from btBroadphaseAabbCallback:
Thanks,
Erwin
Code: Select all
virtual void aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
Erwin
-
- Posts: 5
- Joined: Mon Jan 31, 2011 2:45 pm
Re: Get bodies in AABB
Worked great! Thanks a bunch!