mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 03:34:24 +02:00
Rig::computeMotionAnimationState better filtering of small dt velocities.
Only update _lastVelocity when dt is sufficiently large.
This commit is contained in:
parent
06de087802
commit
f9dc05c989
1 changed files with 6 additions and 2 deletions
|
@ -446,7 +446,9 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
glm::vec3 workingVelocity = _lastVelocity;
|
||||
glm::vec3 positionDelta = worldPosition - _lastPosition;
|
||||
|
||||
// don't trust position delta if deltaTime is 'small'.
|
||||
// Don't trust position delta if deltaTime is 'small'.
|
||||
// NOTE: This is mostly just a work around for an issue in oculus 0.7 runtime, where
|
||||
// Application::idle() is being called more frequently and with smaller dt's then expected.
|
||||
const float SMALL_DELTA_TIME = 0.006f; // 6 ms
|
||||
if (deltaTime > SMALL_DELTA_TIME) {
|
||||
workingVelocity = positionDelta / deltaTime;
|
||||
|
@ -459,7 +461,9 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
}
|
||||
#endif
|
||||
|
||||
_lastVelocity = workingVelocity;
|
||||
if (deltaTime > SMALL_DELTA_TIME) {
|
||||
_lastVelocity = workingVelocity;
|
||||
}
|
||||
|
||||
if (_enableAnimGraph) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue