mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-13 11:06:55 +02:00
cleaner initialization of JointState
This commit is contained in:
parent
9f2a4ae626
commit
b15b0fd96c
2 changed files with 11 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue