set linear/angular velocity to zero when objects are asleep
Thanks to http://code.google.com/p/bullet/issues/detail?id=73 improve performance of btConvexTriangleMeshShape::recalcLocalAabb Thanks to fullmetalcoder, http://code.google.com/p/bullet/issues/detail?id=67#makechanges
This commit is contained in:
@@ -489,6 +489,12 @@ void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
|
||||
{
|
||||
if (body->getActivationState() == ACTIVE_TAG)
|
||||
body->setActivationState( WANTS_DEACTIVATION );
|
||||
if (body->getActivationState() == ISLAND_SLEEPING)
|
||||
{
|
||||
body->setAngularVelocity(btVector3(0,0,0));
|
||||
body->setLinearVelocity(btVector3(0,0,0));
|
||||
}
|
||||
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user