mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
limit filtering carryover
This commit is contained in:
1 parent
005a9707ef
commit
ae12d8afa2
1 file changed
+2
-1
@@ -28,6 +28,7 @@ private const val UPSAMPLING_EXTRAPOLATION_LOG_BASE_MAX = 3f
|
||||
// Upsampling (technically Smoothing but always active)
|
||||
private const val UPSAMPLING_TIME_CARRYOVER_MIN = 0.6f
|
||||
private const val UPSAMPLING_TIME_CARRYOVER_MAX = 0.9f
|
||||
private val UPSAMPLING_TIME_CARRYOVER_LIMIT = 900.milliseconds
|
||||
|
||||
// Smoothing
|
||||
private const val SMOOTHING_MS_MAX = 75.0
|
||||
@@ -72,7 +73,7 @@ private fun computeTimeBetweenPoses(
|
||||
timeCarryover: Double,
|
||||
): Duration {
|
||||
// Use some of last pose's remaining time
|
||||
val lastPoseCarryoverTime = timeLeftForLastPose?.let { it * timeCarryover } ?: Duration.ZERO
|
||||
val lastPoseCarryoverTime = timeLeftForLastPose?.let { it.coerceAtMost(UPSAMPLING_TIME_CARRYOVER_LIMIT) * timeCarryover } ?: Duration.ZERO
|
||||
return (lastPoseCarryoverTime + poseTimeDelta).coerceAtLeast(Duration.ZERO)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user