diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index e028ee89ea..e604bdb925 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -299,22 +299,22 @@ void RenderableModelEntityItem::render(RenderArgs* args) { bool movingOrAnimating = isMoving() || isAnimatingSomething(); if ((movingOrAnimating || - _needsInitialSimulation // || - // _model->getTranslation() != getPosition() || - // _model->getRotation() != getRotation() - ) + _needsInitialSimulation || + _model->getTranslation() != getPosition() || + _model->getRotation() != getRotation() || + _model->getRegistrationPoint() != getRegistrationPoint()) && _model->isActive() && _dimensionsInitialized) { _model->setScaleToFit(true, getDimensions()); _model->setSnapModelToRegistrationPoint(true, getRegistrationPoint()); _model->setRotation(getRotation()); _model->setTranslation(getPosition()); - + // make sure to simulate so everything gets set up correctly for rendering { PerformanceTimer perfTimer("_model->simulate"); _model->simulate(0.0f); } - + _needsInitialSimulation = false; } } diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index a8194f76e3..1745984add 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -193,15 +193,8 @@ void EntityMotionState::setWorldTransform(const btTransform& worldTrans) { measureBodyAcceleration(); _entity->setPosition(bulletToGLM(worldTrans.getOrigin()) + ObjectMotionState::getWorldOffset()); _entity->setRotation(bulletToGLM(worldTrans.getRotation())); - - glm::vec3 velocity = getBodyLinearVelocity(); - if (glm::length2(velocity) < MIN_LINEAR_SPEED_SQUARED) { - velocity *= 0.0f; - } - _entity->setVelocity(velocity); - + _entity->setVelocity(getBodyLinearVelocity()); _entity->setAngularVelocity(getBodyAngularVelocity()); - _entity->setLastSimulated(usecTimestampNow()); if (_entity->getSimulatorID().isNull()) { diff --git a/libraries/physics/src/ObjectMotionState.cpp b/libraries/physics/src/ObjectMotionState.cpp index 144ba1e100..7a384e32d1 100644 --- a/libraries/physics/src/ObjectMotionState.cpp +++ b/libraries/physics/src/ObjectMotionState.cpp @@ -80,19 +80,7 @@ void ObjectMotionState::setBodyGravity(const glm::vec3& gravity) const { } glm::vec3 ObjectMotionState::getBodyLinearVelocity() const { - - btVector3 velocity = _body->getLinearVelocity(); - - // NOTE: the threshold to use here relates to the linear displacement threshold (dX) for sending updates - // to objects that are tracked server-side (e.g. entities which use dX = 2mm). Hence an object moving - // just under this velocity threshold would trigger an update about V/dX times per second. - const float MIN_LINEAR_SPEED_SQUARED = 0.0036f; // 6 mm/sec - if (velocity.length2() < MIN_LINEAR_SPEED_SQUARED) { - velocity *= 0.0f; - } - return bulletToGLM(velocity); - - // return bulletToGLM(_body->getLinearVelocity()); + return bulletToGLM(_body->getLinearVelocity()); } glm::vec3 ObjectMotionState::getObjectLinearVelocityChange() const {