add JointState::getPositionInParentFrame()

This commit is contained in:
Andrew Meadows 2014-07-16 08:52:21 -07:00
parent ecc83e9559
commit 509445d1a2
2 changed files with 5 additions and 1 deletions

View file

@ -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);

View file

@ -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();