From fbe3cb9511c8d2e143e23e0dd7f3dad668d8f72e Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 19 Oct 2015 09:56:51 -0700 Subject: [PATCH] try another way of fixing held object snagging at slow velocity --- libraries/physics/src/EntityMotionState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index b6487103d1..2290f5832e 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -256,6 +256,10 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) { _serverPosition = bulletToGLM(xform.getOrigin()); _serverRotation = bulletToGLM(xform.getRotation()); _serverVelocity = getBodyLinearVelocity(); + if (glm::length2(_serverVelocity) < MIN_LINEAR_SPEED_SQUARED) { + _serverVelocity *= 0.0f; + } + _serverAngularVelocity = bulletToGLM(_body->getAngularVelocity()); _lastStep = simulationStep; _serverActionData = _entity->getActionData();