mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 12:13:40 +02:00
Fix for glitch when entering inAir state from takeoff.
This was due to a frame lag of blend factor used for inAir blending. So the first frame the upward velocity would be 0, followed by 3.5 m/s the next frame. This is fixed by using the workingVelocity instead of _lastVelocity to drive the blend.
This commit is contained in:
parent
b92d1061c4
commit
e210fadc7c
1 changed files with 1 additions and 1 deletions
|
@ -926,7 +926,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
|
||||
// compute blend based on velocity
|
||||
const float JUMP_SPEED = 3.5f;
|
||||
float alpha = glm::clamp(-_lastVelocity.y / JUMP_SPEED, -1.0f, 1.0f) + 1.0f;
|
||||
float alpha = glm::clamp(-workingVelocity.y / JUMP_SPEED, -1.0f, 1.0f) + 1.0f;
|
||||
_animVars.set("inAirAlpha", alpha);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue