cleaner initialization of JointState

This commit is contained in:
Andrew Meadows 2014-05-28 17:31:07 -07:00
parent 9f2a4ae626
commit b15b0fd96c
2 changed files with 11 additions and 4 deletions

View file

@ -139,9 +139,6 @@ QVector<JointState> Model::createJointStates(const FBXGeometry& geometry) {
QVector<JointState> jointStates;
foreach (const FBXJoint& joint, geometry.joints) {
JointState state;
state._translation = joint.translation;
state._rotation = joint.rotation;
state._animationPriority = 0.0f;
state.setFBXJoint(joint);
jointStates.append(state);
}
@ -1896,8 +1893,18 @@ void AnimationHandle::replaceMatchingPriorities(float newPriority) {
}
}
// ----------------------------------------------------------------------------
// JointState TODO: move this class to its own files
// ----------------------------------------------------------------------------
JointState::JointState() :
_translation(0.0f),
_animationPriority(0.0f),
_fbxJoint(NULL) {
}
void JointState::setFBXJoint(const FBXJoint& joint) {
assert(&joint != NULL);
_translation = joint.translation;
_rotation = joint.rotation;
_fbxJoint = &joint;
}

View file

@ -40,7 +40,7 @@ public:
glm::quat _combinedRotation; // rotation from joint local to world frame
float _animationPriority; // the priority of the animation affecting this joint
void setFBXJoint(const FBXJoint& joint) { _fbxJoint = &joint; }
void setFBXJoint(const FBXJoint& joint);
const FBXJoint& getFBXJoint() const { return *_fbxJoint; }
private: