From cc5f2ee4510d4b662c6178cf1debee6b722fd2b3 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 6 May 2015 16:26:27 -0700 Subject: [PATCH] in isMovingVsServer look at entity velocity only --- libraries/physics/src/EntityMotionState.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index c532c3e85e..27fa51b5d4 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -96,9 +96,17 @@ bool EntityMotionState::isMoving() const { } bool EntityMotionState::isMovingVsServer() const { - auto alignmentDot = glm::abs(glm::dot(_sentRotation, _entity->getRotation())); - if (glm::distance(_sentPosition, _entity->getPosition()) > IGNORE_POSITION_DELTA || - alignmentDot < IGNORE_ALIGNMENT_DOT) { + // auto alignmentDot = glm::abs(glm::dot(_sentRotation, _entity->getRotation())); + // if (glm::distance(_sentPosition, _entity->getPosition()) > IGNORE_POSITION_DELTA || + // alignmentDot < IGNORE_ALIGNMENT_DOT) { + // return true; + // } + // return false; + + if (glm::length(_entity->getVelocity()) > IGNORE_LINEAR_VELOCITY_DELTA) { + return true; + } + if (glm::length(_entity->getAngularVelocity()) > IGNORE_ANGULAR_VELOCITY_DELTA) { return true; } return false;