From 619d1ba19110e5b406f9ad5e051dcb9e7446d091 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 16 Apr 2015 14:09:33 -0700 Subject: [PATCH] rename to measureAcceleration --- libraries/physics/src/EntityMotionState.cpp | 4 ++-- libraries/physics/src/ObjectMotionState.cpp | 4 ++-- libraries/physics/src/ObjectMotionState.h | 4 ++-- libraries/physics/src/PhysicsEngine.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index 6838d977eb..871ee21c45 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -62,7 +62,7 @@ void EntityMotionState::stepKinematicSimulation(quint64 now) { // which is different from physical kinematic motion (inside getWorldTransform()) // which steps in physics simulation time. _entity->simulate(now); - // TODO: we can't use ObjectMotionState::measureVelocityAndAcceleration() here because the entity + // TODO: we can't use ObjectMotionState::measureAcceleration() here because the entity // has no RigidBody and the timestep is a little bit out of sync with the physics simulation anyway. // Hence we must manually measure kinematic velocity and acceleration. } @@ -95,7 +95,7 @@ void EntityMotionState::getWorldTransform(btTransform& worldTrans) const { // This callback is invoked by the physics simulation at the end of each simulation step... // iff the corresponding RigidBody is DYNAMIC and has moved. void EntityMotionState::setWorldTransform(const btTransform& worldTrans) { - measureVelocityAndAcceleration(); + measureAcceleration(); _entity->setPosition(bulletToGLM(worldTrans.getOrigin()) + ObjectMotionState::getWorldOffset()); _entity->setRotation(bulletToGLM(worldTrans.getRotation())); diff --git a/libraries/physics/src/ObjectMotionState.cpp b/libraries/physics/src/ObjectMotionState.cpp index 9d9e7e6798..3d790ff7d4 100644 --- a/libraries/physics/src/ObjectMotionState.cpp +++ b/libraries/physics/src/ObjectMotionState.cpp @@ -68,7 +68,7 @@ ObjectMotionState::~ObjectMotionState() { assert(_body == NULL); } -void ObjectMotionState::measureVelocityAndAcceleration() { +void ObjectMotionState::measureAcceleration() { // try to manually measure the true acceleration of the object uint32_t numSubsteps = _simulationStep - _lastSimulationStep; if (numSubsteps > 0) { @@ -84,7 +84,7 @@ void ObjectMotionState::measureVelocityAndAcceleration() { } } -void ObjectMotionState::resetMeasuredVelocityAndAcceleration() { +void ObjectMotionState::resetMeasuredAcceleration() { _lastSimulationStep = _simulationStep; _lastVelocity = bulletToGLM(_body->getLinearVelocity()); } diff --git a/libraries/physics/src/ObjectMotionState.h b/libraries/physics/src/ObjectMotionState.h index 2c77ca6b5e..c5dd31d1f2 100644 --- a/libraries/physics/src/ObjectMotionState.h +++ b/libraries/physics/src/ObjectMotionState.h @@ -62,8 +62,8 @@ public: ObjectMotionState(); ~ObjectMotionState(); - void measureVelocityAndAcceleration(); - void resetMeasuredVelocityAndAcceleration(); + void measureAcceleration(); + void resetMeasuredAcceleration(); // An EASY update does not require the object to be removed and then reinserted into the PhysicsEngine virtual void updateObjectEasy(uint32_t flags, uint32_t frame) = 0; diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index 34ac6732a7..aa9921be64 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -194,7 +194,7 @@ void PhysicsEngine::relayIncomingChangesToSimulation() { motionState->updateObjectEasy(flags, _numSubsteps); } if (flags & (EntityItem::DIRTY_POSITION | EntityItem::DIRTY_VELOCITY)) { - motionState->resetMeasuredVelocityAndAcceleration(); + motionState->resetMeasuredAcceleration(); } } else { // the only way we should ever get here (motionState exists but no body) is when the object @@ -511,7 +511,7 @@ void PhysicsEngine::addObject(const ShapeInfo& shapeInfo, btCollisionShape* shap body->setFriction(motionState->_friction); body->setDamping(motionState->_linearDamping, motionState->_angularDamping); _dynamicsWorld->addRigidBody(body); - motionState->resetMeasuredVelocityAndAcceleration(); + motionState->resetMeasuredAcceleration(); } void PhysicsEngine::removeObjectFromBullet(ObjectMotionState* motionState) {