Limit prediction slerp amount (#1388)

This commit is contained in:
Butterscotch! authored and GitHub committed 2025-04-15 18:51:21 +02:00
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)