From d33400f6ad114e85086d2b738e0f8f85fd94cc4b Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 28 Feb 2019 15:25:15 -0800 Subject: [PATCH] fix GCC compiler warning --- libraries/physics/src/ObjectActionTractor.cpp | 2 +- libraries/shared/src/NestableTransformNode.h | 2 +- libraries/shared/src/SpatiallyNestable.cpp | 22 +++++++++---------- libraries/shared/src/SpatiallyNestable.h | 6 ++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libraries/physics/src/ObjectActionTractor.cpp b/libraries/physics/src/ObjectActionTractor.cpp index a46aac3f29..c7681e217c 100644 --- a/libraries/physics/src/ObjectActionTractor.cpp +++ b/libraries/physics/src/ObjectActionTractor.cpp @@ -60,7 +60,7 @@ bool ObjectActionTractor::getTarget(float deltaTimeStep, glm::quat& rotation, gl } if (other && otherIsReady) { bool success; - glm::vec3 otherWorldPosition = other->getWorldPosition(_otherJointIndex, success); + glm::vec3 otherWorldPosition = other->getJointWorldPosition(_otherJointIndex, success); if (!success) { linearTimeScale = FLT_MAX; angularTimeScale = FLT_MAX; diff --git a/libraries/shared/src/NestableTransformNode.h b/libraries/shared/src/NestableTransformNode.h index be017a696d..a584bcd308 100644 --- a/libraries/shared/src/NestableTransformNode.h +++ b/libraries/shared/src/NestableTransformNode.h @@ -32,7 +32,7 @@ public: } bool success; - Transform jointWorldTransform = nestable->getTransform(_jointIndex, success); + Transform jointWorldTransform = nestable->getJointTransform(_jointIndex, success); if (!success) { return Transform(); diff --git a/libraries/shared/src/SpatiallyNestable.cpp b/libraries/shared/src/SpatiallyNestable.cpp index e7bdc87bf3..d202afc59f 100644 --- a/libraries/shared/src/SpatiallyNestable.cpp +++ b/libraries/shared/src/SpatiallyNestable.cpp @@ -92,7 +92,7 @@ Transform SpatiallyNestable::getParentTransform(bool& success, int depth) const return result; } if (parent) { - result = parent->getTransform(_parentJointIndex, success, depth + 1); + result = parent->getJointTransform(_parentJointIndex, success, depth + 1); if (getScalesWithParent()) { result.setScale(parent->scaleForChildren()); } @@ -203,7 +203,7 @@ glm::vec3 SpatiallyNestable::worldToLocal(const glm::vec3& position, } if (parent) { - parentTransform = parent->getTransform(parentJointIndex, success); + parentTransform = parent->getJointTransform(parentJointIndex, success); if (!success) { return glm::vec3(0.0f); } @@ -240,7 +240,7 @@ glm::quat SpatiallyNestable::worldToLocal(const glm::quat& orientation, } if (parent) { - parentTransform = parent->getTransform(parentJointIndex, success); + parentTransform = parent->getJointTransform(parentJointIndex, success); if (!success) { return glm::quat(); } @@ -350,7 +350,7 @@ glm::vec3 SpatiallyNestable::localToWorld(const glm::vec3& position, } if (parent) { - parentTransform = parent->getTransform(parentJointIndex, success); + parentTransform = parent->getJointTransform(parentJointIndex, success); if (!success) { return glm::vec3(0.0f); } @@ -390,7 +390,7 @@ glm::quat SpatiallyNestable::localToWorld(const glm::quat& orientation, } if (parent) { - parentTransform = parent->getTransform(parentJointIndex, success); + parentTransform = parent->getJointTransform(parentJointIndex, success); if (!success) { return glm::quat(); } @@ -525,8 +525,8 @@ glm::vec3 SpatiallyNestable::getWorldPosition() const { return result; } -glm::vec3 SpatiallyNestable::getWorldPosition(int jointIndex, bool& success) const { - return getTransform(jointIndex, success).getTranslation(); +glm::vec3 SpatiallyNestable::getJointWorldPosition(int jointIndex, bool& success) const { + return getJointTransform(jointIndex, success).getTranslation(); } void SpatiallyNestable::setWorldPosition(const glm::vec3& position, bool& success, bool tellPhysics) { @@ -579,7 +579,7 @@ glm::quat SpatiallyNestable::getWorldOrientation() const { } glm::quat SpatiallyNestable::getWorldOrientation(int jointIndex, bool& success) const { - return getTransform(jointIndex, success).getRotation(); + return getJointTransform(jointIndex, success).getRotation(); } void SpatiallyNestable::setWorldOrientation(const glm::quat& orientation, bool& success, bool tellPhysics) { @@ -765,7 +765,7 @@ void SpatiallyNestable::breakParentingLoop() const { } } -const Transform SpatiallyNestable::getTransform(int jointIndex, bool& success, int depth) const { +const Transform SpatiallyNestable::getJointTransform(int jointIndex, bool& success, int depth) const { // this returns the world-space transform for this object. It finds its parent's transform (which may // cause this object's parent to query its parent, etc) and multiplies this object's local transform onto it. Transform jointInWorldFrame; @@ -832,8 +832,8 @@ glm::vec3 SpatiallyNestable::getSNScale(bool& success) const { return getTransform(success).getScale(); } -glm::vec3 SpatiallyNestable::getSNScale(int jointIndex, bool& success) const { - return getTransform(jointIndex, success).getScale(); +glm::vec3 SpatiallyNestable::getJointSNScale(int jointIndex, bool& success) const { + return getJointTransform(jointIndex, success).getScale(); } void SpatiallyNestable::setSNScale(const glm::vec3& scale) { diff --git a/libraries/shared/src/SpatiallyNestable.h b/libraries/shared/src/SpatiallyNestable.h index a802a25e89..6b709f0352 100644 --- a/libraries/shared/src/SpatiallyNestable.h +++ b/libraries/shared/src/SpatiallyNestable.h @@ -129,9 +129,9 @@ public: virtual void setSNScale(const glm::vec3& scale, bool& success); // get world-frame values for a specific joint - virtual const Transform getTransform(int jointIndex, bool& success, int depth = 0) const; - virtual glm::vec3 getWorldPosition(int jointIndex, bool& success) const; - virtual glm::vec3 getSNScale(int jointIndex, bool& success) const; + virtual const Transform getJointTransform(int jointIndex, bool& success, int depth = 0) const; + virtual glm::vec3 getJointWorldPosition(int jointIndex, bool& success) const; + virtual glm::vec3 getJointSNScale(int jointIndex, bool& success) const; // object's parent's frame virtual Transform getLocalTransform() const;