mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
AnimInverseKinematics: update _maxTargetIndex correctly.
This commit is contained in:
parent
756eb54a0a
commit
ad49d0dd59
2 changed files with 8 additions and 2 deletions
|
@ -144,6 +144,10 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar
|
|||
target.pose = AnimPose::identity;
|
||||
target.rootIndex = findRootJointInSkeleton(_skeleton, targetVar.jointIndex);
|
||||
_absoluteTargets[targetVar.jointIndex] = target;
|
||||
|
||||
if (targetVar.jointIndex > _maxTargetIndex) {
|
||||
_maxTargetIndex = targetVar.jointIndex;
|
||||
}
|
||||
} else {
|
||||
qCWarning(animation) << "AnimInverseKinematics could not find jointName" << targetVar.jointName << "in skeleton";
|
||||
}
|
||||
|
@ -608,6 +612,8 @@ void AnimInverseKinematics::setSkeletonInternal(AnimSkeleton::ConstPointer skele
|
|||
// invalidate all targets
|
||||
_absoluteTargets.clear();
|
||||
|
||||
_maxTargetIndex = 0;
|
||||
|
||||
// No constraints!
|
||||
/*
|
||||
if (skeleton) {
|
||||
|
|
|
@ -444,8 +444,8 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
static float t = 0.0f;
|
||||
_animVars.set("sine", static_cast<float>(0.5 * sin(t) + 0.5));
|
||||
|
||||
_animVars.set("rightHandPosition", glm::vec3(cos(t), sin(t) + 1.0f, 1.0f));
|
||||
_animVars.set("leftHandPosition", glm::vec3(cos(-t + 3.1415f), sin(-t + 3.1415f) + 1.0f, 1.0f));
|
||||
_animVars.set("rightHandPosition", glm::vec3(0.5f * cos(t), 0.5f * sin(t) + 1.5f, 1.0f));
|
||||
_animVars.set("leftHandPosition", glm::vec3(0.5f * cos(-t + 3.1415f), 0.5f * sin(-t + 3.1415f) + 1.5f, 1.0f));
|
||||
|
||||
// default anim vars to notMoving and notTurning
|
||||
_animVars.set("isMovingForward", false);
|
||||
|
|
Loading…
Reference in a new issue