sync RigidBody on deactivation

This commit is contained in:
Andrew Meadows 2017-03-10 12:55:16 -08:00
parent a16760278e
commit 9c9eb87925

View file

@ -104,6 +104,11 @@ void EntityMotionState::handleDeactivation() {
_entity->setOrientation(_serverRotation, success, false);
_entity->setVelocity(ENTITY_ITEM_ZERO_VEC3);
_entity->setAngularVelocity(ENTITY_ITEM_ZERO_VEC3);
// and also to RigidBody
btTransform worldTrans;
worldTrans.setOrigin(glmToBullet(_serverPosition));
worldTrans.setRotation(glmToBullet(_serverRotation));
// no need to update velocities... should already be zero
}
// virtual