mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 00:51:20 -08:00
Fix Stay Aligned first frame being way too strong
This commit is contained in:
1 parent
e2406cacac
commit
9667fd93be
1 file changed
+1
-2
@@ -63,8 +63,6 @@ class TrackerStayAlignedBehaviour(
|
||||
*/
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private fun observeRun(receiver: Tracker) {
|
||||
var lastRotationTime = timeSource.markNow()
|
||||
|
||||
val serverFlow = receiver.appContext.server.context.state
|
||||
|
||||
val enabledFlow = settings.context.state.map { it.data.stayAlignedConfig.enabled }.distinctUntilChanged()
|
||||
@@ -76,6 +74,7 @@ class TrackerStayAlignedBehaviour(
|
||||
|
||||
// Ignore every other emission for performance (50FPS instead of 100FPS when at 100TPS)
|
||||
var index = 0
|
||||
var lastRotationTime = timeSource.markNow()
|
||||
receiver.context.state
|
||||
.distinctUntilChangedBy { it.rawRotation }
|
||||
.filter { index++ % 2 == 0 }
|
||||
|
||||
Reference in new issue
Block a user