mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 01:13:32 +02:00
working on the hand blend alphas, something is wrong with the print out
This commit is contained in:
parent
375d726535
commit
bac9d195be
1 changed files with 8 additions and 1 deletions
|
@ -43,9 +43,16 @@ const AnimPoseVec& AnimBlendLinear::evaluate(const AnimVariantMap& animVars, con
|
|||
size_t prevPoseIndex = glm::floor(clampedAlpha);
|
||||
size_t nextPoseIndex = glm::ceil(clampedAlpha);
|
||||
float alpha = glm::fract(clampedAlpha);
|
||||
if (prevPoseIndex == nextPoseIndex) {
|
||||
if (nextPoseIndex == 0) {
|
||||
nextPoseIndex = 1;
|
||||
} else if (prevPoseIndex == (_children.size() - 1)) {
|
||||
prevPoseIndex = (_children.size() - 2);
|
||||
}
|
||||
}
|
||||
evaluateAndBlendChildren(animVars, context, triggersOut, alpha, prevPoseIndex, nextPoseIndex, dt);
|
||||
|
||||
|
||||
qCDebug(animation) << "linear blend alpha " << alpha << " next pose " << _children[nextPoseIndex]->getID() << " previous pose " << _children[prevPoseIndex]->getID();
|
||||
float weight2 = alpha;
|
||||
float weight1 = 1.0f - weight2;
|
||||
_animStack[_children[prevPoseIndex]->getID()] = weight1 * parentAlpha;
|
||||
|
|
Loading…
Reference in a new issue