Update server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt

Co-authored-by: Eiren Rain <[email protected]>
This commit is contained in:
Ilia KiandEiren Rain authored and GitHub committed 2025-05-13 02:06:00 +07:00
1 parent db68d808dd
commit c8a6e2fc0b
1 file changed
+3 -2
@@ -440,10 +440,11 @@ class Tracker @JvmOverloads constructor(
companion object {
/**
* Changes from IMU axis to OpenGL/SteamVR axis
* Turn 90 degrees around LEFT axis to make the base position of the tracker standing upwards
* instead of laying on the back
*/
fun axisOffset(v: Vector3): Vector3 = Vector3(v.x, v.z, -v.y)
private val rotationOffset = Quaternion(INV_SQRT_TWO, -INV_SQRT_TWO, 0f, 0f)
fun axisOffset(v: Vector3): Vector3 = rotationOffset.sandwich(v)
fun axisOffset(q: Quaternion): Quaternion = rotationOffset * q
}
}