mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
fix for clearJointData() in JS scripts
let the JointState class verify animation priority
This commit is contained in:
parent
3fbbeecb8c
commit
6cdee21a50
1 changed files with 4 additions and 6 deletions
|
@ -708,12 +708,10 @@ void Model::clearJointAnimationPriority(int index) {
|
||||||
void Model::setJointState(int index, bool valid, const glm::quat& rotation, float priority) {
|
void Model::setJointState(int index, bool valid, const glm::quat& rotation, float priority) {
|
||||||
if (index != -1 && index < _jointStates.size()) {
|
if (index != -1 && index < _jointStates.size()) {
|
||||||
JointState& state = _jointStates[index];
|
JointState& state = _jointStates[index];
|
||||||
if (priority >= state._animationPriority) {
|
if (valid) {
|
||||||
if (valid) {
|
state.setRotationInConstrainedFrame(rotation, priority);
|
||||||
state.setRotationInConstrainedFrame(rotation, priority);
|
} else {
|
||||||
} else {
|
state.restoreRotation(1.0f, priority);
|
||||||
state.restoreRotation(1.0f, priority);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue