mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 21:02:17 +02:00
Use clamp
This commit is contained in:
parent
0f183b409b
commit
0f1b12475e
1 changed files with 1 additions and 2 deletions
|
@ -1191,8 +1191,7 @@ void Rig::updateAnimations(float deltaTime, const glm::mat4& rootTransform, cons
|
|||
_networkPoseSet._relativePoses = _networkNode->evaluate(_networkVars, context, deltaTime, networkTriggersOut);
|
||||
_networkAnimState.blendTime += deltaTime;
|
||||
alpha = _computeNetworkAnimation ? (_networkAnimState.blendTime / TOTAL_BLEND_TIME) : (1.0f - (_networkAnimState.blendTime / TOTAL_BLEND_TIME));
|
||||
alpha = alpha > 1.0f ? 1.0f : alpha;
|
||||
alpha = alpha < 0.0f ? 0.0f : alpha;
|
||||
alpha = glm::clamp(alpha, 0.0f, 1.0f);
|
||||
for (size_t i = 0; i < _networkPoseSet._relativePoses.size(); i++) {
|
||||
_networkPoseSet._relativePoses[i].blend(_internalPoseSet._relativePoses[i], alpha);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue