mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-05 16:22:32 -08:00
TrackersHID clearly define acceleration axes (#1431)
This commit is contained in:
1 parent
ea31d58fb8
commit
a35d2a77a2
1 file changed
+7
-1
+7
-1
@@ -435,7 +435,13 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
tracker.setRotation(rot)
|
||||
}
|
||||
if (packetType == 1 || packetType == 2) {
|
||||
// TODO: Acceleration "was" wrong
|
||||
// Acceleration is in local device frame
|
||||
// On flat surface / face up:
|
||||
// Right side of the device is +X
|
||||
// Front side (facing up) is +Z
|
||||
// Mounted on body / standing up:
|
||||
// Top side of the device is +Y
|
||||
// Front side (facing out) is +Z
|
||||
val scaleAccel = 1 / (1 shl 7).toFloat() // compile time evaluation
|
||||
var acceleration = Vector3(a[0].toFloat(), a[1].toFloat(), a[2].toFloat()).times(scaleAccel) // no division
|
||||
tracker.setAcceleration(acceleration)
|
||||
|
||||
Reference in new issue
Block a user