Updating Broadphase after transforming an object

Dominik
Posts: 32
Joined: Fri Dec 19, 2008 2:51 pm

Updating Broadphase after transforming an object

Post by Dominik »

Hi

I currently have a problem when using bullet solely for ray casts.
I have a collision world set up, and occasionally move an object by setting its world transform
However, this does not seem to update the broadphase and thus the ray cast is not successfully possible.

If I use performDiscreteCollisionDetection() after the transform update/raytest, the broadphase is updated and works fine.
However, that's not exactly what I want, since this also tests for collisions, thus wasting performance.

So, is there a way to update just the broadphase after a transformation? Didn't find a way...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Updating Broadphase after transforming an object

Post by Erwin Coumans »

to update all AABBs you can call:

Code: Select all

collisionWorld->updateAabbs();
to update only a single AABB, you can use

Code: Select all

void	btCollisionWorld::updateSingleAabb(btCollisionObject* colObj);
Hope this helps,
Erwin
Dominik
Posts: 32
Joined: Fri Dec 19, 2008 2:51 pm

Re: Updating Broadphase after transforming an object

Post by Dominik »

Awesome, thanks alot! :D