Fix tracker reset logic (#1150)

This commit is contained in:
Butterscotch! authored and GitHub committed 2024-09-13 02:41:56 +02:00
1 parent 2c146169ac
commit 1c867efe16
2 files changed
+8 -6

No files matched your search

@@ -323,7 +323,8 @@ class Tracker @JvmOverloads constructor(
_rotation
}
if (needsReset || (isComputed && !isInternal)) {
// Reset if needed and is not computed and internal
if (needsReset && !(isComputed && isInternal)) {
// Adjust to reset, mounting and drift compensation
rot = resetsHandler.getReferenceAdjustedDriftRotationFrom(rot)
}
@@ -354,7 +355,8 @@ class Tracker @JvmOverloads constructor(
_rotation
}
if (needsReset || (isComputed && trackerPosition == TrackerPosition.HEAD)) {
// Reset if needed or is a computed tracker besides head
if (needsReset && !(isComputed && trackerPosition != TrackerPosition.HEAD)) {
// Adjust to reset and mounting
rot = resetsHandler.getIdentityAdjustedDriftRotationFrom(rot)
}