From db1690377ab6f904b5b71a89005b222a43d6d5df Mon Sep 17 00:00:00 2001 From: Butterscotch! Date: Fri, 2 Oct 2026 03:43:28 -0400 Subject: [PATCH] Fix StepMountingResult output --- .../java/dev/slimevr/stepmounting/recording-processor.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/core/src/main/java/dev/slimevr/stepmounting/recording-processor.kt b/server/core/src/main/java/dev/slimevr/stepmounting/recording-processor.kt index 04b3a8bf9..c424ec223 100644 --- a/server/core/src/main/java/dev/slimevr/stepmounting/recording-processor.kt +++ b/server/core/src/main/java/dev/slimevr/stepmounting/recording-processor.kt @@ -4,6 +4,7 @@ import dev.slimevr.tracker.HeadingAlignment import dev.slimevr.util.inFloatingSeconds import io.github.axisangles.ktmath.Quaternion import io.github.axisangles.ktmath.Vector3 +import kotlin.math.abs import kotlin.math.atan2 import kotlin.time.ComparableTimeMark import kotlin.time.Duration @@ -73,8 +74,8 @@ fun estimateHeadingAlign( // Compute mounting to fix the yaw offset from tracker to HMD // OLD: angle(trackerXZ.unit()) * angle(hmdXZ.unit()).inv() return StepMountingResult( - Quaternion.fromTo(trackerXZ.unit(), hmdXZ.unit()), - trackerXZ.len() - hmdXZ.len(), + Quaternion.fromTo(trackerXZ.unit(), hmdXZ.unit()).unit(), + abs(trackerXZ.len() - hmdXZ.len()), trackerOffset, bias, )