Activated rigid body is still in air.
-
- Posts: 49
- Joined: Sun Jan 29, 2012 10:01 pm
Activated rigid body is still in air.
When I have made a hole in a height field, I activate all rigid bodies in the area but they are still sleeping in the air for about 1 second before they fall down or go back to sleep in the air. They claim to be active directly when I have activated them but they don't fall down instantly. I use Bullet 2.79.
-
- Posts: 49
- Joined: Sun Jan 29, 2012 10:01 pm
Re: Activated rigid body is still in air.
When I run into a mountain from the side and make a hole in it, the vehicle behave as if there was no hole until it has moved around a bit. Reversing and going forward again makes the collision update according to the height field and let the vehicle pass without a collision.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: Activated rigid body is still in air.
It could be that contact points are not updated because you changed the collision shape. If you modify collision shapes, the best way is to remove the objects first, then make the modification, and re-insert it into the world.
Alternatively, you can manually flush the contact points for a given object using an API call, for example:
Alternatively, you can manually flush the contact points for a given object using an API call, for example:
Code: Select all
world->getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(object->getBroadphaseHandle(),world->getDispatcher());
-
- Posts: 49
- Joined: Sun Jan 29, 2012 10:01 pm
Re: Activated rigid body is still in air.
Thanks, I will try flushing whenever a collision shape has been modified.
Edit:
Both methods worked fine.
Edit:
Both methods worked fine.