mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Reset joint priorities back to 0 for new animation system.
Added Rig::clearJointStatePriorities() to do this.
This commit is contained in:
parent
4b31d87bf5
commit
c970ff0c0c
2 changed files with 10 additions and 1 deletions
|
@ -591,8 +591,10 @@ void Rig::updateAnimations(float deltaTime, glm::mat4 rootTransform) {
|
|||
_animVars.setTrigger(trigger);
|
||||
}
|
||||
|
||||
clearJointStatePriorities();
|
||||
|
||||
// copy poses into jointStates
|
||||
const float PRIORITY = 3.0f;
|
||||
const float PRIORITY = 1.0f;
|
||||
for (size_t i = 0; i < poses.size(); i++) {
|
||||
setJointRotationInConstrainedFrame((int)i, glm::inverse(_animSkeleton->getRelativeBindPose(i).rot) * poses[i].rot, PRIORITY, false, 1.0f);
|
||||
}
|
||||
|
@ -930,6 +932,12 @@ void Rig::updateVisibleJointStates() {
|
|||
}
|
||||
}
|
||||
|
||||
void Rig::clearJointStatePriorities() {
|
||||
for (int i = 0; i < _jointStates.size(); i++) {
|
||||
_jointStates[i].setAnimationPriority(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Rig::setJointVisibleTransform(int jointIndex, glm::mat4 newTransform) {
|
||||
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
|
||||
return;
|
||||
|
|
|
@ -172,6 +172,7 @@ public:
|
|||
bool getJointRotationInConstrainedFrame(int jointIndex, glm::quat& rotOut) const;
|
||||
glm::quat getJointDefaultRotationInParentFrame(int jointIndex);
|
||||
void updateVisibleJointStates();
|
||||
void clearJointStatePriorities();
|
||||
|
||||
virtual void updateJointState(int index, glm::mat4 rootTransform) = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue