mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 21:43:13 +02:00
AnimController fix for crash if underPoses vector was empty.
This commit is contained in:
parent
75ecf0020d
commit
39aef6edc9
2 changed files with 7 additions and 2 deletions
|
@ -56,7 +56,12 @@ const AnimPoseVec& AnimController::overlay(const AnimVariantMap& animVars, float
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jointVar.jointIndex >= 0) {
|
if (jointVar.jointIndex >= 0) {
|
||||||
AnimPose pose(animVars.lookup(jointVar.var, underPoses[jointVar.jointIndex]));
|
AnimPose pose;
|
||||||
|
if (jointVar.jointIndex <= (int)underPoses.size()) {
|
||||||
|
pose = AnimPose(animVars.lookup(jointVar.var, underPoses[jointVar.jointIndex]));
|
||||||
|
} else {
|
||||||
|
pose = AnimPose(animVars.lookup(jointVar.var, AnimPose::identity));
|
||||||
|
}
|
||||||
_poses[jointVar.jointIndex] = pose;
|
_poses[jointVar.jointIndex] = pose;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -962,7 +962,7 @@ void Rig::updateLeanJoint(int index, float leanSideways, float leanForward, floa
|
||||||
AnimPose pose = _animSkeleton->getRelativeBindPose(index);
|
AnimPose pose = _animSkeleton->getRelativeBindPose(index);
|
||||||
pose.rot = rot;
|
pose.rot = rot;
|
||||||
_animVars.set("lean", static_cast<glm::mat4>(pose));
|
_animVars.set("lean", static_cast<glm::mat4>(pose));
|
||||||
} else {
|
} else if (!_enableAnimGraph) {
|
||||||
auto& parentState = _jointStates[_jointStates[index].getParentIndex()];
|
auto& parentState = _jointStates[_jointStates[index].getParentIndex()];
|
||||||
|
|
||||||
// get the rotation axes in joint space and use them to adjust the rotation
|
// get the rotation axes in joint space and use them to adjust the rotation
|
||||||
|
|
Loading…
Reference in a new issue