Limit prediction slerp amount (#1388)

This commit is contained in:
Butterscotch!
2025-04-15 12:51:21 -04:00
committed by GitHub
parent 3dfaf1fdac
commit 44fc23d2f8

View File

@@ -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)