From 509445d1a2f2df6502c8e5db75e5c4fae1b0e928 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 16 Jul 2014 08:52:21 -0700 Subject: [PATCH] add JointState::getPositionInParentFrame() --- interface/src/renderer/JointState.cpp | 3 +++ interface/src/renderer/JointState.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/src/renderer/JointState.cpp b/interface/src/renderer/JointState.cpp index 01b81f6e56..acf096c71a 100644 --- a/interface/src/renderer/JointState.cpp +++ b/interface/src/renderer/JointState.cpp @@ -19,6 +19,7 @@ JointState::JointState() : _animationPriority(0.0f), + _positionInParentFrame(0.0f), _fbxJoint(NULL), _constraint(NULL) { } @@ -27,6 +28,7 @@ JointState::JointState(const JointState& other) : _constraint(NULL) { _transform = other._transform; _rotation = other._rotation; _rotationInConstrainedFrame = other._rotationInConstrainedFrame; + _positionInParentFrame = other._positionInParentFrame; _animationPriority = other._animationPriority; _fbxJoint = other._fbxJoint; // DO NOT copy _constraint @@ -69,6 +71,7 @@ void JointState::copyState(const JointState& state) { _transform = state._transform; _rotation = extractRotation(_transform); _rotationInConstrainedFrame = state._rotationInConstrainedFrame; + _positionInParentFrame = state._positionInParentFrame; _visibleTransform = state._visibleTransform; _visibleRotation = extractRotation(_visibleTransform); diff --git a/interface/src/renderer/JointState.h b/interface/src/renderer/JointState.h index b4c3633dfa..86ee5d01b7 100644 --- a/interface/src/renderer/JointState.h +++ b/interface/src/renderer/JointState.h @@ -50,6 +50,7 @@ public: glm::quat getRotationInParentFrame() const; glm::quat getVisibleRotationInParentFrame() const; + const glm::vec3& getPositionInParentFrame() const { return _positionInParentFrame; } int getParentIndex() const { return _fbxJoint->parentIndex; } @@ -90,12 +91,12 @@ public: float _animationPriority; // the priority of the animation affecting this joint -private: /// \return parent model-frame rotation // (used to keep _rotation consistent when modifying _rotationInWorldFrame directly) glm::quat computeParentRotation() const; glm::quat computeVisibleParentRotation() const; +private: /// debug helper function void loadBindRotation();