diff --git a/interface/src/avatar/AvatarMotionState.cpp b/interface/src/avatar/AvatarMotionState.cpp index 7f11c83c4a..84f276529a 100644 --- a/interface/src/avatar/AvatarMotionState.cpp +++ b/interface/src/avatar/AvatarMotionState.cpp @@ -41,7 +41,7 @@ void AvatarMotionState::clearIncomingDirtyFlags() { } } -MotionType AvatarMotionState::computeObjectMotionType() const { +PhysicsMotionType AvatarMotionState::computePhysicsMotionType() const { // TODO?: support non-DYNAMIC motion for avatars? (e.g. when sitting) return MOTION_TYPE_DYNAMIC; } diff --git a/interface/src/avatar/AvatarMotionState.h b/interface/src/avatar/AvatarMotionState.h index f02dba54bd..51b4e5627e 100644 --- a/interface/src/avatar/AvatarMotionState.h +++ b/interface/src/avatar/AvatarMotionState.h @@ -22,12 +22,12 @@ class AvatarMotionState : public ObjectMotionState { public: AvatarMotionState(Avatar* avatar, btCollisionShape* shape); - virtual MotionType getMotionType() const override { return _motionType; } + virtual PhysicsMotionType getMotionType() const override { return _motionType; } virtual uint32_t getIncomingDirtyFlags() override; virtual void clearIncomingDirtyFlags() override; - virtual MotionType computeObjectMotionType() const override; + virtual PhysicsMotionType computePhysicsMotionType() const override; virtual bool isMoving() const override; diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index 2c09c3aa55..74fc7b0716 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -139,7 +139,7 @@ bool EntityMotionState::handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine* return ObjectMotionState::handleHardAndEasyChanges(flags, engine); } -MotionType EntityMotionState::computeObjectMotionType() const { +PhysicsMotionType EntityMotionState::computePhysicsMotionType() const { if (!_entity) { return MOTION_TYPE_STATIC; } @@ -157,7 +157,7 @@ bool EntityMotionState::isMoving() const { // This callback is invoked by the physics simulation in two cases: // (1) when the RigidBody is first added to the world -// (irregardless of MotionType: STATIC, DYNAMIC, or KINEMATIC) +// (irregardless of PhysicsMotionType: STATIC, DYNAMIC, or KINEMATIC) // (2) at the beginning of each simulation step for KINEMATIC RigidBody's -- // it is an opportunity for outside code to update the object's simulation position void EntityMotionState::getWorldTransform(btTransform& worldTrans) const { @@ -608,7 +608,7 @@ glm::vec3 EntityMotionState::getObjectLinearVelocityChange() const { } // virtual -void EntityMotionState::setMotionType(MotionType motionType) { +void EntityMotionState::setMotionType(PhysicsMotionType motionType) { ObjectMotionState::setMotionType(motionType); resetMeasuredBodyAcceleration(); } @@ -627,7 +627,7 @@ void EntityMotionState::computeCollisionGroupAndMask(int16_t& group, int16_t& ma if (_entity->getIgnoreForCollisions()) { group = BULLET_COLLISION_GROUP_COLLISIONLESS; } - switch (computeObjectMotionType()){ + switch (computePhysicsMotionType()){ case MOTION_TYPE_STATIC: group = BULLET_COLLISION_GROUP_STATIC; break; diff --git a/libraries/physics/src/EntityMotionState.h b/libraries/physics/src/EntityMotionState.h index 7d7987b641..b579d4442d 100644 --- a/libraries/physics/src/EntityMotionState.h +++ b/libraries/physics/src/EntityMotionState.h @@ -32,8 +32,8 @@ public: virtual bool handleEasyChanges(uint32_t& flags); virtual bool handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine* engine); - /// \return MOTION_TYPE_DYNAMIC or MOTION_TYPE_STATIC based on params set in EntityItem - virtual MotionType computeObjectMotionType() const; + /// \return PhysicsMotionType based on params set in EntityItem + virtual PhysicsMotionType computePhysicsMotionType() const; virtual bool isMoving() const; @@ -94,7 +94,7 @@ protected: virtual bool isReadyToComputeShape() const override; virtual btCollisionShape* computeNewShape(); - virtual void setMotionType(MotionType motionType); + virtual void setMotionType(PhysicsMotionType motionType); // In the glorious future (when entities lib depends on physics lib) the EntityMotionState will be // properly "owned" by the EntityItem and will be deleted by it in the dtor. In pursuit of that diff --git a/libraries/physics/src/ObjectMotionState.cpp b/libraries/physics/src/ObjectMotionState.cpp index ecce821adf..482c3146f8 100644 --- a/libraries/physics/src/ObjectMotionState.cpp +++ b/libraries/physics/src/ObjectMotionState.cpp @@ -120,7 +120,7 @@ void ObjectMotionState::releaseShape() { } } -void ObjectMotionState::setMotionType(MotionType motionType) { +void ObjectMotionState::setMotionType(PhysicsMotionType motionType) { _motionType = motionType; } diff --git a/libraries/physics/src/ObjectMotionState.h b/libraries/physics/src/ObjectMotionState.h index 4a90b1d985..539327ce0c 100644 --- a/libraries/physics/src/ObjectMotionState.h +++ b/libraries/physics/src/ObjectMotionState.h @@ -23,13 +23,13 @@ #include "ContactInfo.h" #include "ShapeManager.h" -enum MotionType { +enum PhysicsMotionType { MOTION_TYPE_STATIC, // no motion MOTION_TYPE_DYNAMIC, // motion according to physical laws MOTION_TYPE_KINEMATIC // keyframed motion }; -inline QString motionTypeToString(MotionType motionType) { +inline QString motionTypeToString(PhysicsMotionType motionType) { switch(motionType) { case MOTION_TYPE_STATIC: return QString("static"); case MOTION_TYPE_DYNAMIC: return QString("dynamic"); @@ -88,7 +88,7 @@ public: virtual void updateBodyMassProperties(); MotionStateType getType() const { return _type; } - virtual MotionType getMotionType() const { return _motionType; } + virtual PhysicsMotionType getMotionType() const { return _motionType; } void setMass(float mass) { _mass = fabsf(mass); } float getMass() { return _mass; } @@ -105,7 +105,7 @@ public: virtual uint32_t getIncomingDirtyFlags() = 0; virtual void clearIncomingDirtyFlags() = 0; - virtual MotionType computeObjectMotionType() const = 0; + virtual PhysicsMotionType computePhysicsMotionType() const = 0; btCollisionShape* getShape() const { return _shape; } btRigidBody* getRigidBody() const { return _body; } @@ -150,13 +150,13 @@ public: protected: virtual bool isReadyToComputeShape() const = 0; virtual btCollisionShape* computeNewShape() = 0; - void setMotionType(MotionType motionType); + void setMotionType(PhysicsMotionType motionType); void updateCCDConfiguration(); void setRigidBody(btRigidBody* body); MotionStateType _type = MOTIONSTATE_TYPE_INVALID; // type of MotionState - MotionType _motionType; // type of motion: KINEMATIC, DYNAMIC, or STATIC + PhysicsMotionType _motionType; // type of motion: KINEMATIC, DYNAMIC, or STATIC btCollisionShape* _shape; btRigidBody* _body; diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index b665be5d53..691f2b89c5 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -98,7 +98,7 @@ void PhysicsEngine::addObjectToDynamicsWorld(ObjectMotionState* motionState) { float mass = 0.0f; // NOTE: the body may or may not already exist, depending on whether this corresponds to a reinsertion, or a new insertion. btRigidBody* body = motionState->getRigidBody(); - MotionType motionType = motionState->computeObjectMotionType(); + PhysicsMotionType motionType = motionState->computePhysicsMotionType(); motionState->setMotionType(motionType); switch(motionType) { case MOTION_TYPE_KINEMATIC: {