From 2400f5c00004f6397eeabf23b457de8ea3a416b6 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 1 Jun 2015 09:02:59 -0700 Subject: [PATCH] update ALL parameters of remote physics simulation --- libraries/physics/src/EntityMotionState.cpp | 23 +++++++-------------- libraries/physics/src/EntityMotionState.h | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index 9a24aabb34..15be1da3ed 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -49,24 +49,17 @@ EntityMotionState::~EntityMotionState() { assert(!_entity); } -void EntityMotionState::updateServerPhysicsVariables(uint32_t flags) { - if (flags & EntityItem::DIRTY_POSITION) { - _serverPosition = _entity->getPosition(); - } - if (flags & EntityItem::DIRTY_ROTATION) { - _serverRotation = _entity->getRotation(); - } - if (flags & EntityItem::DIRTY_LINEAR_VELOCITY) { - _serverVelocity = _entity->getVelocity(); - } - if (flags & EntityItem::DIRTY_ANGULAR_VELOCITY) { - _serverAngularVelocity = _entity->getAngularVelocity(); - } +void EntityMotionState::updateServerPhysicsVariables() { + _serverPosition = _entity->getPosition(); + _serverRotation = _entity->getRotation(); + _serverVelocity = _entity->getVelocity(); + _serverAngularVelocity = _entity->getAngularVelocity(); + _serverAcceleration = _entity->getAcceleration(); } // virtual void EntityMotionState::handleEasyChanges(uint32_t flags) { - updateServerPhysicsVariables(flags); + updateServerPhysicsVariables(); ObjectMotionState::handleEasyChanges(flags); if (flags & EntityItem::DIRTY_SIMULATOR_ID) { _loopsWithoutOwner = 0; @@ -94,7 +87,7 @@ void EntityMotionState::handleEasyChanges(uint32_t flags) { // virtual void EntityMotionState::handleHardAndEasyChanges(uint32_t flags, PhysicsEngine* engine) { - updateServerPhysicsVariables(flags); + updateServerPhysicsVariables(); ObjectMotionState::handleHardAndEasyChanges(flags, engine); } diff --git a/libraries/physics/src/EntityMotionState.h b/libraries/physics/src/EntityMotionState.h index 65279dc01a..2be6d0490e 100644 --- a/libraries/physics/src/EntityMotionState.h +++ b/libraries/physics/src/EntityMotionState.h @@ -28,7 +28,7 @@ public: EntityMotionState(btCollisionShape* shape, EntityItemPointer item); virtual ~EntityMotionState(); - void updateServerPhysicsVariables(uint32_t flags); + void updateServerPhysicsVariables(); virtual void handleEasyChanges(uint32_t flags); virtual void handleHardAndEasyChanges(uint32_t flags, PhysicsEngine* engine);