mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
Limit prediction slerp amount (#1388)
This commit is contained in:
1 parent
3dfaf1fdac
commit
44fc23d2f8
1 file changed
+1
-1
@@ -64,7 +64,7 @@ class QuaternionMovingAverage(
|
||||
rotBuffer?.forEach { quatBuf *= it }
|
||||
|
||||
// Calculate how much to slerp
|
||||
val amt = predictFactor * fpsTimer.timePerFrame
|
||||
val amt = (predictFactor * fpsTimer.timePerFrame).coerceAtMost(1f)
|
||||
|
||||
// Slerps the target rotation to that predicted rotation by amt
|
||||
filteredQuaternion = filteredQuaternion.interpR(quatBuf, amt)
|
||||
|
||||
Reference in new issue
Block a user