Lazy evaluation of collisions

Eugene
Posts: 1
Joined: Tue Aug 11, 2009 5:39 pm

Lazy evaluation of collisions

Post by Eugene »

Hi.

We have a world that has an important number of Ghosts and relatively complex collision primitives ( Static floors etc..)

For performances reasons, we had to deactivate the collision of Ghosts and Static object ( via the broadphase filter mechanism).

At some point in the game we need to evaluate if a given Ghosts collisions with (*any*) static object.

So basically we want to generate all collision pairs with the given ghost and calculate the contact points without stepping the whole physics world.

Is this possible ?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Lazy evaluation of collisions

Post by Erwin Coumans »

The btGhostObject can already perform on-demand collision detection, check out the Bullet/Demos/CharacterDemo.

If you switch collision filter flags, you first need to remove the object from the world, change flags, and re-insert it.
Hope this helps,
Erwin