Merge pull request #13998 from AndrewMeadows/dont-zero-kinematic

don't zero kinematic velocities when releasing simulation ownership
This commit is contained in:
John Conklin II 2018-09-14 15:18:06 -07:00 committed by GitHub
commit 49e578ebef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -446,8 +446,9 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationStep) {
void EntityMotionState::updateSendVelocities() {
if (!_body->isActive()) {
// make sure all derivatives are zero
clearObjectVelocities();
if (!_body->isKinematicObject()) {
clearObjectVelocities();
}
// we pretend we sent the inactive update for this object
_numInactiveUpdates = 1;
} else {

View file

@ -138,7 +138,6 @@ void PhysicalEntitySimulation::changeEntityInternal(EntityItemPointer entity) {
btRigidBody* body = motionState->getRigidBody();
if (body) {
body->forceActivationState(ISLAND_SLEEPING);
motionState->updateSendVelocities(); // has side-effect of zeroing entity velocities for inactive body
}
// send packet to remove ownership