From 8cd101ac57a3cdeae4f253477e3a5fde04bdbd11 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 28 May 2014 15:57:38 -0700 Subject: [PATCH] Added getJointCombinedRotation to Models --- interface/src/renderer/Model.cpp | 12 ++++++++++-- interface/src/renderer/Model.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index 678a4b09c0..91c14d7758 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -641,8 +641,16 @@ bool Model::getJointRotation(int jointIndex, glm::quat& rotation, bool fromBind) return false; } rotation = _jointStates[jointIndex].combinedRotation * - (fromBind ? _geometry->getFBXGeometry().joints[jointIndex].inverseBindRotation : - _geometry->getFBXGeometry().joints[jointIndex].inverseDefaultRotation); + (fromBind ? _geometry->getFBXGeometry().joints[jointIndex].inverseBindRotation : + _geometry->getFBXGeometry().joints[jointIndex].inverseDefaultRotation); + return true; +} + +bool Model::getJointCombinedRotation(int jointIndex, glm::quat& rotation) const { + if (jointIndex == -1 || _jointStates.isEmpty()) { + return false; + } + rotation = _jointStates[jointIndex].combinedRotation; return true; } diff --git a/interface/src/renderer/Model.h b/interface/src/renderer/Model.h index a4e45287dd..91429a3677 100644 --- a/interface/src/renderer/Model.h +++ b/interface/src/renderer/Model.h @@ -123,6 +123,7 @@ public: bool getJointPosition(int jointIndex, glm::vec3& position) const; bool getJointRotation(int jointIndex, glm::quat& rotation, bool fromBind = false) const; + bool getJointCombinedRotation(int jointIndex, glm::quat& rotation) const; QStringList getJointNames() const;