mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 12:54:30 +02:00
Don't evaluate overPoses if alpha is 0.0.
This commit is contained in:
parent
f843c01b35
commit
aad6958b68
1 changed files with 12 additions and 7 deletions
|
@ -54,15 +54,20 @@ const AnimPoseVec& AnimOverlay::evaluate(const AnimVariantMap& animVars, const A
|
||||||
|
|
||||||
if (_children.size() >= 2) {
|
if (_children.size() >= 2) {
|
||||||
auto& underPoses = _children[1]->evaluate(animVars, context, dt, triggersOut);
|
auto& underPoses = _children[1]->evaluate(animVars, context, dt, triggersOut);
|
||||||
auto& overPoses = _children[0]->overlay(animVars, context, dt, triggersOut, underPoses);
|
|
||||||
|
|
||||||
if (underPoses.size() > 0 && underPoses.size() == overPoses.size()) {
|
if (_alpha == 0.0f) {
|
||||||
_poses.resize(underPoses.size());
|
_poses = underPoses;
|
||||||
assert(_boneSetVec.size() == _poses.size());
|
} else {
|
||||||
|
auto& overPoses = _children[0]->overlay(animVars, context, dt, triggersOut, underPoses);
|
||||||
|
|
||||||
for (size_t i = 0; i < _poses.size(); i++) {
|
if (underPoses.size() > 0 && underPoses.size() == overPoses.size()) {
|
||||||
float alpha = _boneSetVec[i] * _alpha;
|
_poses.resize(underPoses.size());
|
||||||
::blend(1, &underPoses[i], &overPoses[i], alpha, &_poses[i]);
|
assert(_boneSetVec.size() == _poses.size());
|
||||||
|
|
||||||
|
for (size_t i = 0; i < _poses.size(); i++) {
|
||||||
|
float alpha = _boneSetVec[i] * _alpha;
|
||||||
|
::blend(1, &underPoses[i], &overPoses[i], alpha, &_poses[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue