From 576273efe34727ac1b4aef03fc84df461430de4e Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Tue, 16 Jan 2018 18:01:58 -0800 Subject: [PATCH] Remove Rig::restoreJointPosition and references to it. --- libraries/animation/src/Rig.cpp | 10 ---------- libraries/animation/src/Rig.h | 4 ---- .../src/avatars-renderer/SkeletonModel.cpp | 8 -------- .../src/avatars-renderer/SkeletonModel.h | 10 ---------- libraries/render-utils/src/Model.cpp | 13 ------------- libraries/render-utils/src/Model.h | 8 -------- 6 files changed, 53 deletions(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index daa1c2618f..3c16ad71b1 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1050,16 +1050,6 @@ void Rig::updateAnimations(float deltaTime, const glm::mat4& rootTransform, cons } } -void Rig::inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm::quat& targetRotation, float priority, - const QVector& freeLineage, glm::mat4 rootTransform) { - ASSERT(false); -} - -bool Rig::restoreJointPosition(int jointIndex, float fraction, float priority, const QVector& freeLineage) { - ASSERT(false); - return false; -} - float Rig::getLimbLength(int jointIndex, const QVector& freeLineage, const glm::vec3 scale, const QVector& fbxJoints) const { ASSERT(false); diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h index 6968d7c3af..0877e7326d 100644 --- a/libraries/animation/src/Rig.h +++ b/libraries/animation/src/Rig.h @@ -172,10 +172,6 @@ public: // Regardless of who started the animations or how many, update the joints. void updateAnimations(float deltaTime, const glm::mat4& rootTransform, const glm::mat4& rigToWorldTransform); - // legacy - void inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm::quat& targetRotation, float priority, - const QVector& freeLineage, glm::mat4 rootTransform); - // legacy bool restoreJointPosition(int jointIndex, float fraction, float priority, const QVector& freeLineage); diff --git a/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp b/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp index a13ef07cd4..557fbb8670 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp @@ -237,10 +237,6 @@ bool SkeletonModel::getRightHandPosition(glm::vec3& position) const { return getJointPositionInWorldFrame(getRightHandJointIndex(), position); } -bool SkeletonModel::restoreLeftHandPosition(float fraction, float priority) { - return restoreJointPosition(getLeftHandJointIndex(), fraction, priority); -} - bool SkeletonModel::getLeftShoulderPosition(glm::vec3& position) const { return getJointPositionInWorldFrame(getLastFreeJointIndex(getLeftHandJointIndex()), position); } @@ -249,10 +245,6 @@ float SkeletonModel::getLeftArmLength() const { return getLimbLength(getLeftHandJointIndex()); } -bool SkeletonModel::restoreRightHandPosition(float fraction, float priority) { - return restoreJointPosition(getRightHandJointIndex(), fraction, priority); -} - bool SkeletonModel::getRightShoulderPosition(glm::vec3& position) const { return getJointPositionInWorldFrame(getLastFreeJointIndex(getRightHandJointIndex()), position); } diff --git a/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.h b/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.h index f911ad0c5a..0407a5b580 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.h +++ b/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.h @@ -57,11 +57,6 @@ public: /// \return true whether or not the position was found bool getRightHandPosition(glm::vec3& position) const; - /// Restores some fraction of the default position of the left hand. - /// \param fraction the fraction of the default position to restore - /// \return whether or not the left hand joint was found - bool restoreLeftHandPosition(float fraction = 1.0f, float priority = 1.0f); - /// Gets the position of the left shoulder. /// \return whether or not the left shoulder joint was found bool getLeftShoulderPosition(glm::vec3& position) const; @@ -69,11 +64,6 @@ public: /// Returns the extended length from the left hand to its last free ancestor. float getLeftArmLength() const; - /// Restores some fraction of the default position of the right hand. - /// \param fraction the fraction of the default position to restore - /// \return whether or not the right hand joint was found - bool restoreRightHandPosition(float fraction = 1.0f, float priority = 1.0f); - /// Gets the position of the right shoulder. /// \return whether or not the right shoulder joint was found bool getRightShoulderPosition(glm::vec3& position) const; diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 9c1c579341..f04c7e4cc0 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1259,19 +1259,6 @@ void Model::updateClusterMatrices() { } } -void Model::inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm::quat& targetRotation, float priority) { - const FBXGeometry& geometry = getFBXGeometry(); - const QVector& freeLineage = geometry.joints.at(endIndex).freeLineage; - glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset); - _rig.inverseKinematics(endIndex, targetPosition, targetRotation, priority, freeLineage, parentTransform); -} - -bool Model::restoreJointPosition(int jointIndex, float fraction, float priority) { - const FBXGeometry& geometry = getFBXGeometry(); - const QVector& freeLineage = geometry.joints.at(jointIndex).freeLineage; - return _rig.restoreJointPosition(jointIndex, fraction, priority, freeLineage); -} - float Model::getLimbLength(int jointIndex) const { const FBXGeometry& geometry = getFBXGeometry(); const QVector& freeLineage = geometry.joints.at(jointIndex).freeLineage; diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h index 623f869666..a7b46d2991 100644 --- a/libraries/render-utils/src/Model.h +++ b/libraries/render-utils/src/Model.h @@ -199,8 +199,6 @@ public: /// Returns the index of the parent of the indexed joint, or -1 if not found. int getParentJointIndex(int jointIndex) const; - void inverseKinematics(int jointIndex, glm::vec3 position, const glm::quat& rotation, float priority); - /// Returns the extents of the model in its bind pose. Extents getBindExtents() const; @@ -368,12 +366,6 @@ protected: void computeMeshPartLocalBounds(); virtual void updateRig(float deltaTime, glm::mat4 parentTransform); - /// Restores the indexed joint to its default position. - /// \param fraction the fraction of the default position to apply (i.e., 0.25f to slerp one fourth of the way to - /// the original position - /// \return true if the joint was found - bool restoreJointPosition(int jointIndex, float fraction = 1.0f, float priority = 0.0f); - /// Computes and returns the extended length of the limb terminating at the specified joint and starting at the joint's /// first free ancestor. float getLimbLength(int jointIndex) const;