mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
patch for head going wrong way
This commit is contained in:
1 parent
ac4eb8f5d8
commit
c06fa006a5
1 file changed
+6
-1
@@ -41,11 +41,16 @@ fun reduce(
|
||||
val position = action.position ?: state.position
|
||||
|
||||
val cal = state.sessionCalibration
|
||||
// TODO: figure out better fix for this that applies in state for StayAligned
|
||||
// (positional head can get a non-identity headingAlignment when not assigned to head and it persists when
|
||||
// assigning back to head and even loading from config)
|
||||
val isPositionalHead = state.position != null && state.bodyPart == BodyPart.HEAD
|
||||
val headingAlignment = if (!isPositionalHead) cal.headingAlignment else Quaternion.IDENTITY
|
||||
|
||||
// Rotation calibration
|
||||
val rotation: CalibratedRotation =
|
||||
if (action.rotation != null) {
|
||||
applyCalibration(correctedRawRotation, cal.headingCorrection, cal.attitudeAlignment, cal.headingAlignment, state.restOrientation)
|
||||
applyCalibration(correctedRawRotation, cal.headingCorrection, cal.attitudeAlignment, headingAlignment, state.restOrientation)
|
||||
.twinNearest(polarityAlign)
|
||||
} else {
|
||||
state.rotation
|
||||
|
||||
Reference in new issue
Block a user