diff --git a/package-lock.json b/package-lock.json index d8c267fd1..e1e28299e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "slimevr-ui", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "slimevr-ui", - "version": "0.5.0", + "version": "0.5.1", "workspaces": [ "solarxr-protocol", "gui" @@ -19,7 +19,7 @@ }, "gui": { "name": "slimevr-ui", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "@fontsource/poppins": "^4.5.8", "@tauri-apps/api": "^1.0.2", diff --git a/server/src/main/java/com/jme3/math/Quaternion.java b/server/src/main/java/com/jme3/math/Quaternion.java index d83718be5..a5a17471d 100644 --- a/server/src/main/java/com/jme3/math/Quaternion.java +++ b/server/src/main/java/com/jme3/math/Quaternion.java @@ -1436,8 +1436,8 @@ public final class Quaternion implements Cloneable, java.io.Serializable { float invNorm = 1.0f / norm; return new Quaternion(-x * invNorm, -y * invNorm, -z * invNorm, w * invNorm); } - // return an invalid result to flag the error - return null; + // return itself since it has no inverse + return this; } /** diff --git a/server/src/main/java/dev/slimevr/poserecorder/PoseFrameTracker.java b/server/src/main/java/dev/slimevr/poserecorder/PoseFrameTracker.java index 4a9bdf74a..bcc1a228c 100644 --- a/server/src/main/java/dev/slimevr/poserecorder/PoseFrameTracker.java +++ b/server/src/main/java/dev/slimevr/poserecorder/PoseFrameTracker.java @@ -150,6 +150,18 @@ public class PoseFrameTracker implements Tracker, Iterable { return false; } + @Override + public boolean getRawRotation(Quaternion store) { + TrackerFrame frame = safeGetFrame(); + if (frame != null && frame.hasData(TrackerFrameData.ROTATION)) { + store.set(frame.rotation); + return true; + } + + store.set(Quaternion.IDENTITY); + return false; + } + @Override public boolean getPosition(Vector3f store) { TrackerFrame frame = safeGetFrame(); diff --git a/server/src/main/java/dev/slimevr/poserecorder/TrackerFrame.java b/server/src/main/java/dev/slimevr/poserecorder/TrackerFrame.java index 501e93e7f..415cdd953 100644 --- a/server/src/main/java/dev/slimevr/poserecorder/TrackerFrame.java +++ b/server/src/main/java/dev/slimevr/poserecorder/TrackerFrame.java @@ -94,6 +94,17 @@ public final class TrackerFrame implements Tracker { return false; } + @Override + public boolean getRawRotation(Quaternion store) { + if (hasData(TrackerFrameData.ROTATION)) { + store.set(rotation); + return true; + } + + store.set(Quaternion.IDENTITY); + return false; + } + @Override public boolean getPosition(Vector3f store) { if (hasData(TrackerFrameData.POSITION)) { diff --git a/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java b/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java index 5dd5974fb..c0dc38f54 100644 --- a/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java +++ b/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java @@ -174,7 +174,7 @@ public class RPCHandler extends ProtocolHandler this.api.server.resetTrackers(); if (req.resetType() == ResetType.Mounting) this.api.server.resetTrackersMounting(); - LogManager.severe("[WebSocketAPI] Reset performed"); + LogManager.info("[WebSocketAPI] Reset performed"); } public void onAssignTrackerRequest(GenericConnection conn, RpcMessageHeader messageHeader) { diff --git a/server/src/main/java/dev/slimevr/vr/trackers/ComputedTracker.java b/server/src/main/java/dev/slimevr/vr/trackers/ComputedTracker.java index ac86bda6d..5549730da 100644 --- a/server/src/main/java/dev/slimevr/vr/trackers/ComputedTracker.java +++ b/server/src/main/java/dev/slimevr/vr/trackers/ComputedTracker.java @@ -80,6 +80,12 @@ public class ComputedTracker implements Tracker, TrackerWithTPS { return true; } + @Override + public boolean getRawRotation(Quaternion store) { + store.set(rotation); + return true; + } + @Override public boolean getAcceleration(Vector3f store) { store.set(0, 0, 0); diff --git a/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java b/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java index 3418b7b75..25ff43a13 100644 --- a/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java +++ b/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java @@ -23,12 +23,17 @@ public class IMUTracker // public final Vector3f gyroVector = new Vector3f(); public final Vector3f accelVector = new Vector3f(); - public final Vector3f magVector = new Vector3f(); + // public final Vector3f magVector = new Vector3f(); public final Quaternion rotQuaternion = new Quaternion(); public final Quaternion rotMagQuaternion = new Quaternion(); - public final Quaternion rotAdjust = new Quaternion(); + public final Quaternion mountAdjust = new Quaternion(); public final UDPDevice device; public final int trackerNum; + public final Vector3f rotVector = new Vector3f(); + public final Quaternion gyroFix = new Quaternion(); + public final Quaternion attachmentFix = new Quaternion(); + public final Quaternion mountRotFix = new Quaternion(); + public final Quaternion yawFix = new Quaternion(); protected final Quaternion correction = new Quaternion(); protected final int trackerId; protected final String name; @@ -70,10 +75,12 @@ public class IMUTracker this.descriptiveName = descriptiveName; this.vrserver = vrserver; - setFiltering( - vrserver.getConfigManager().getVrConfig().getFilters().enumGetType(), - vrserver.getConfigManager().getVrConfig().getFilters().getAmount() - ); + if (vrserver != null) { + setFiltering( + vrserver.getConfigManager().getVrConfig().getFilters().enumGetType(), + vrserver.getConfigManager().getVrConfig().getFilters().getAmount() + ); + } } @Override @@ -89,16 +96,15 @@ public class IMUTracker @Override public void readConfig(TrackerConfig config) { // Loading a config is an act of user editing, therefore it shouldn't - // not be - // allowed if editing is not allowed + // be allowed if editing is not allowed if (userEditable()) { setCustomName(config.getCustomName()); if (config.getMountingRotation() != null) { mounting = config.getMountingRotation(); - rotAdjust.set(config.getMountingRotation()); + mountAdjust.set(config.getMountingRotation()); } else { - rotAdjust.loadIdentity(); + mountAdjust.loadIdentity(); } Optional trackerPosition = TrackerPosition .getByDesignation(config.getDesignation()); @@ -117,9 +123,9 @@ public class IMUTracker public void setMountingRotation(Quaternion mr) { mounting = mr; if (mounting != null) { - rotAdjust.set(mounting); + mountAdjust.set(mounting); } else { - rotAdjust.loadIdentity(); + mountAdjust.loadIdentity(); } } @@ -189,9 +195,15 @@ public class IMUTracker store.set(rotQuaternion); } // correction.mult(store, store); // Correction is not used now to - // prevent - // accidental errors while debugging other things - store.multLocal(rotAdjust); + // prevent accidental errors while debugging other things + store.multLocal(mountAdjust); + adjustInternal(store); + return true; + } + + @Override + public boolean getRawRotation(Quaternion store) { + store.set(rotQuaternion); return true; } @@ -250,27 +262,106 @@ public class IMUTracker this.batteryVoltage = voltage; } + /** + * Reset the tracker so that its current rotation is counted as (0, , 0). This allows the tracker to be strapped to body at any pitch and + * roll. + *

+ * Performs {@link #resetYaw(Quaternion)} for yaw drift correction. + */ @Override public void resetFull(Quaternion reference) { + fixGyroscope(getMountedAdjustedRotation()); + fixAttachment(getMountedAdjustedRotation()); + resetYaw(reference); } /** - * Does not perform actual gyro reset to reference, that's the task of - * reference adjusted tracker. Only aligns gyro with magnetometer if it's - * reliable + * Reset the tracker so that it's current yaw rotation is counted as . This allows the tracker to have yaw independent of the HMD. Tracker + * should still report yaw as if it was mounted facing HMD, mounting + * position should be corrected in the source. Also aligns gyro magnetometer + * if it's reliable. */ @Override public void resetYaw(Quaternion reference) { + fixYaw(reference); + if (magCalibrationStatus >= CalibrationAccuracy.HIGH.status) { magnetometerCalibrated = true; // During calibration set correction to match magnetometer readings - // exactly // TODO : Correct only yaw correction.set(rotQuaternion).inverseLocal().multLocal(rotMagQuaternion); } } + protected void adjustInternal(Quaternion store) { + gyroFix.mult(store, store); + store.multLocal(attachmentFix); + store.multLocal(mountRotFix); + yawFix.mult(store, store); + } + + private Quaternion getMountedAdjustedRotation() { + return rotQuaternion.mult(mountAdjust); + } + + private void fixGyroscope(Quaternion sensorRotation) { + sensorRotation.fromAngles(0, sensorRotation.getYaw(), 0); + gyroFix.set(sensorRotation).inverseLocal(); + } + + private void fixAttachment(Quaternion sensorRotation) { + gyroFix.mult(sensorRotation, sensorRotation); + attachmentFix.set(sensorRotation).inverseLocal(); + } + + @Override + public void resetMounting(boolean reverseYaw) { + // Get the current calibrated rotation + Quaternion buffer = getMountedAdjustedRotation(); + gyroFix.mult(buffer, buffer); + buffer.multLocal(attachmentFix); + + // Reset the vector for the rotation to point straight up + rotVector.set(0f, 1f, 0f); + // Rotate the vector by the quat, then flatten and normalize the vector + buffer.multLocal(rotVector).setY(0f).normalizeLocal(); + + // Calculate the yaw angle using tan + // Just use an angle offset of zero for unsolvable circumstances + float yawAngle = FastMath.isApproxZero(rotVector.x) && FastMath.isApproxZero(rotVector.z) + ? 0f + : FastMath.atan2(rotVector.x, rotVector.z); + + // Make an adjustment quaternion from the angle + buffer.fromAngles(0f, reverseYaw ? yawAngle : yawAngle - FastMath.PI, 0f); + + Quaternion lastRotAdjust = mountRotFix.clone(); + mountRotFix.set(buffer); + + // Get the difference from the last adjustment + buffer.multLocal(lastRotAdjust.inverseLocal()); + // Apply the yaw rotation difference to the yaw fix quaternion + yawFix.multLocal(buffer.inverseLocal()); + } + + private void fixYaw(Quaternion reference) { + // Use only yaw HMD rotation + Quaternion targetRotation = reference.clone(); + targetRotation.fromAngles(0, targetRotation.getYaw(), 0); + + Quaternion sensorRotation = getMountedAdjustedRotation(); + gyroFix.mult(sensorRotation, sensorRotation); + sensorRotation.multLocal(attachmentFix); + sensorRotation.multLocal(mountRotFix); + + sensorRotation.fromAngles(0, sensorRotation.getYaw(), 0); + + yawFix.set(sensorRotation).inverseLocal().multLocal(targetRotation); + } + /** * Calculate correction between normal and magnetometer readings up to * accuracy threshold @@ -280,10 +371,6 @@ public class IMUTracker // TODO Print "jump" length when correcting if it's more than 1 degree } - @Override - public void resetMounting(boolean reverseYaw) { - } - @Override public TrackerPosition getBodyPosition() { return bodyPosition; diff --git a/server/src/main/java/dev/slimevr/vr/trackers/ReferenceAdjustedTracker.java b/server/src/main/java/dev/slimevr/vr/trackers/ReferenceAdjustedTracker.java deleted file mode 100644 index f09921fe4..000000000 --- a/server/src/main/java/dev/slimevr/vr/trackers/ReferenceAdjustedTracker.java +++ /dev/null @@ -1,232 +0,0 @@ -package dev.slimevr.vr.trackers; - -import com.jme3.math.FastMath; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector3f; -import dev.slimevr.config.TrackerConfig; -import dev.slimevr.vr.Device; - - -public class ReferenceAdjustedTracker implements Tracker { - - public final E tracker; - - // Vector for mounting rotation correction (tilt direction) - public final Vector3f rotVector = new Vector3f(); - - public final Quaternion gyroFix = new Quaternion(); - public final Quaternion attachmentFix = new Quaternion(); - public final Quaternion mountRotFix = new Quaternion(); - public final Quaternion yawFix = new Quaternion(); - - protected float confidenceMultiplier = 1.0f; - - public ReferenceAdjustedTracker(E tracker) { - this.tracker = tracker; - } - - @Override - public boolean userEditable() { - return this.tracker.userEditable(); - } - - @Override - public void readConfig(TrackerConfig config) { - this.tracker.readConfig(config); - } - - @Override - public void writeConfig(TrackerConfig config) { - this.tracker.writeConfig(config); - } - - /** - * Reset the tracker so that its current rotation is counted as (0, , 0). This allows the tracker to be strapped to body at any pitch and - * roll. - *

- * Performs {@link #resetYaw(Quaternion)} for yaw drift correction. - */ - @Override - public void resetFull(Quaternion reference) { - tracker.resetFull(reference); - - Quaternion sensorRotation = new Quaternion(); - tracker.getRotation(sensorRotation); - - fixGyroscope(sensorRotation.clone()); - fixAttachment(sensorRotation.clone()); - - fixYaw(reference); - } - - /** - * Reset the tracker so that it's current yaw rotation is counted as . This allows the tracker to have yaw independent of the HMD. Tracker - * should still report yaw as if it was mounted facing HMD, mounting - * position should be corrected in the source. - */ - @Override - public void resetYaw(Quaternion reference) { - tracker.resetYaw(reference); - fixYaw(reference); - } - - private void fixGyroscope(Quaternion sensorRotation) { - sensorRotation.fromAngles(0, sensorRotation.getYaw(), 0); - gyroFix.set(sensorRotation).inverseLocal(); - } - - private void fixAttachment(Quaternion sensorRotation) { - gyroFix.mult(sensorRotation, sensorRotation); - attachmentFix.set(sensorRotation).inverseLocal(); - } - - @Override - public void resetMounting(boolean reverseYaw) { - tracker.resetMounting(reverseYaw); - - // Get the current calibrated rotation - Quaternion buffer = new Quaternion(); - tracker.getRotation(buffer); - gyroFix.mult(buffer, buffer); - buffer.multLocal(attachmentFix); - - // Reset the vector for the rotation to point straight up - rotVector.set(0f, 1f, 0f); - // Rotate the vector by the quat, then flatten and normalize the vector - buffer.multLocal(rotVector).setY(0f).normalizeLocal(); - - // Calculate the yaw angle using tan - // Just use an angle offset of zero for unsolvable circumstances - float yawAngle = FastMath.isApproxZero(rotVector.x) && FastMath.isApproxZero(rotVector.z) - ? 0f - : FastMath.atan2(rotVector.x, rotVector.z); - - // Make an adjustment quaternion from the angle - buffer.fromAngles(0f, reverseYaw ? yawAngle : yawAngle - FastMath.PI, 0f); - - Quaternion lastRotAdjust = new Quaternion(mountRotFix); - mountRotFix.set(buffer); - - // Get the difference from the last adjustment - buffer.multLocal(lastRotAdjust.inverseLocal()); - // Apply the yaw rotation difference to the yaw fix quaternion - yawFix.multLocal(buffer.inverseLocal()); - } - - private void fixYaw(Quaternion reference) { - // Use only yaw HMD rotation - Quaternion targetRotation = new Quaternion(reference); - targetRotation.fromAngles(0, targetRotation.getYaw(), 0); - - Quaternion sensorRotation = new Quaternion(); - tracker.getRotation(sensorRotation); - gyroFix.mult(sensorRotation, sensorRotation); - sensorRotation.multLocal(attachmentFix); - sensorRotation.multLocal(mountRotFix); - - sensorRotation.fromAngles(0, sensorRotation.getYaw(), 0); - - yawFix.set(sensorRotation).inverseLocal().multLocal(targetRotation); - } - - protected void adjustInternal(Quaternion store) { - gyroFix.mult(store, store); - store.multLocal(attachmentFix); - store.multLocal(mountRotFix); - yawFix.mult(store, store); - } - - @Override - public boolean getRotation(Quaternion store) { - tracker.getRotation(store); - adjustInternal(store); - return true; - } - - @Override - public boolean getAcceleration(Vector3f store) { - return tracker.getAcceleration(store); - } - - @Override - public boolean getPosition(Vector3f store) { - return tracker.getPosition(store); - } - - @Override - public String getName() { - return tracker.getName(); - } - - @Override - public TrackerStatus getStatus() { - return tracker.getStatus(); - } - - @Override - public float getConfidenceLevel() { - return tracker.getConfidenceLevel() * confidenceMultiplier; - } - - @Override - public TrackerPosition getBodyPosition() { - return tracker.getBodyPosition(); - } - - @Override - public void setBodyPosition(TrackerPosition position) { - tracker.setBodyPosition(position); - } - - @Override - public void tick() { - tracker.tick(); - } - - @Override - public boolean hasRotation() { - return tracker.hasRotation(); - } - - @Override - public boolean hasPosition() { - return tracker.hasPosition(); - } - - @Override - public boolean isComputed() { - return tracker.isComputed(); - } - - @Override - public int getTrackerId() { - return tracker.getTrackerId(); - } - - @Override - public int getTrackerNum() { - return tracker.getTrackerNum(); - } - - @Override - public Device getDevice() { - return tracker.getDevice(); - } - - @Override - public Tracker get() { - return this.tracker; - } - - @Override - public String getDisplayName() { - return this.tracker.getDisplayName(); - } - - @Override - public String getCustomName() { - return this.tracker.getCustomName(); - } -} diff --git a/server/src/main/java/dev/slimevr/vr/trackers/Tracker.java b/server/src/main/java/dev/slimevr/vr/trackers/Tracker.java index 840a2db0a..747eb35ae 100644 --- a/server/src/main/java/dev/slimevr/vr/trackers/Tracker.java +++ b/server/src/main/java/dev/slimevr/vr/trackers/Tracker.java @@ -20,6 +20,8 @@ public interface Tracker { boolean getRotation(Quaternion store); + boolean getRawRotation(Quaternion store); + boolean getAcceleration(Vector3f store); String getName(); @@ -64,9 +66,7 @@ public interface Tracker { /** - * Returns the real tracker behind this tracker. In case this tracker - * transforms another tracker like {@link ReferenceAdjustedTracker}, this - * will return the tracker it modifies. Otherwise, it will return itself. + * Returns the real tracker behind this tracker. */ Tracker get(); diff --git a/server/src/main/java/dev/slimevr/vr/trackers/udp/TrackersUDPServer.java b/server/src/main/java/dev/slimevr/vr/trackers/udp/TrackersUDPServer.java index 6ca2f4877..c757ebc6f 100644 --- a/server/src/main/java/dev/slimevr/vr/trackers/udp/TrackersUDPServer.java +++ b/server/src/main/java/dev/slimevr/vr/trackers/udp/TrackersUDPServer.java @@ -6,13 +6,11 @@ import com.jme3.math.Vector3f; import dev.slimevr.Main; import dev.slimevr.NetworkProtocol; import dev.slimevr.vr.trackers.IMUTracker; -import dev.slimevr.vr.trackers.ReferenceAdjustedTracker; import dev.slimevr.vr.trackers.Tracker; import dev.slimevr.vr.trackers.TrackerStatus; import io.eiren.util.Util; import io.eiren.util.collections.FastList; import io.eiren.util.logging.LogManager; - import org.apache.commons.lang3.ArrayUtils; import java.io.IOException; @@ -239,12 +237,9 @@ public class TrackersUDPServer extends Thread { this, Main.vrServer ); - ReferenceAdjustedTracker adjustedTracker = new ReferenceAdjustedTracker<>( - imu - ); connection.getTrackers().add(imu); - trackersConsumer.accept(adjustedTracker); + trackersConsumer.accept(imu); LogManager .info( "[TrackerServer] Added sensor " diff --git a/server/src/test/java/dev/slimevr/unit/ReferenceAdjustmentsTests.java b/server/src/test/java/dev/slimevr/unit/ReferenceAdjustmentsTests.java index 9bfde4b1b..2a5d360a1 100644 --- a/server/src/test/java/dev/slimevr/unit/ReferenceAdjustmentsTests.java +++ b/server/src/test/java/dev/slimevr/unit/ReferenceAdjustmentsTests.java @@ -3,8 +3,7 @@ package dev.slimevr.unit; import com.jme3.math.FastMath; import com.jme3.math.Quaternion; import dev.slimevr.vr.processor.TransformNode; -import dev.slimevr.vr.trackers.ComputedTracker; -import dev.slimevr.vr.trackers.ReferenceAdjustedTracker; +import dev.slimevr.vr.trackers.IMUTracker; import dev.slimevr.vr.trackers.Tracker; import io.eiren.math.FloatMath; import io.eiren.util.StringUtils; @@ -21,7 +20,7 @@ import static org.junit.jupiter.api.DynamicTest.dynamicTest; /** - * Tests {@link ReferenceAdjustedTracker#resetFull(Quaternion)} + * Tests {@link IMUTracker#resetFull(Quaternion)} */ public class ReferenceAdjustmentsTests { @@ -177,17 +176,19 @@ public class ReferenceAdjustmentsTests { int refRoll ) { Quaternion referenceQuat = q(refPitch, refYaw, refRoll); - ComputedTracker tracker = new ComputedTracker( + IMUTracker tracker = new IMUTracker( + null, Tracker.getNextLocalTrackerId(), + 0, "test", - true, - false + "test", + null, + null ); - tracker.rotation.set(trackerQuat); - ReferenceAdjustedTracker adj = new ReferenceAdjustedTracker<>(tracker); - adj.resetFull(referenceQuat); + tracker.rotQuaternion.set(trackerQuat); + tracker.resetFull(referenceQuat); Quaternion read = new Quaternion(); - assertTrue(adj.getRotation(read), "Adjusted tracker didn't return rotation"); + assertTrue(tracker.getRotation(read), "Adjusted tracker didn't return rotation"); // Use only yaw HMD rotation Quaternion targetTrackerRotation = new Quaternion(referenceQuat); @@ -212,18 +213,21 @@ public class ReferenceAdjustmentsTests { int refYaw, int refRoll ) { + // FIXME Quaternion referenceQuat = q(refPitch, refYaw, refRoll); - ComputedTracker tracker = new ComputedTracker( + IMUTracker tracker = new IMUTracker( + null, Tracker.getNextLocalTrackerId(), + 0, "test", - true, - false + "test", + null, + null ); - tracker.rotation.set(trackerQuat); - ReferenceAdjustedTracker adj = new ReferenceAdjustedTracker<>(tracker); - adj.resetYaw(referenceQuat); + tracker.rotQuaternion.set(trackerQuat); + tracker.resetYaw(referenceQuat); Quaternion read = new Quaternion(); - assertTrue(adj.getRotation(read), "Adjusted tracker didn't return rotation"); + assertTrue(tracker.getRotation(read), "Adjusted tracker didn't return rotation"); assertEquals( new QuatEqualYawWithEpsilon(referenceQuat), new QuatEqualYawWithEpsilon(read), @@ -241,16 +245,19 @@ public class ReferenceAdjustmentsTests { int refYaw, int refRoll ) { + // FIXME Quaternion referenceQuat = q(refPitch, refYaw, refRoll); - ComputedTracker tracker = new ComputedTracker( + IMUTracker tracker = new IMUTracker( + null, Tracker.getNextLocalTrackerId(), + 0, "test", - true, - false + "test", + null, + null ); - tracker.rotation.set(trackerQuat); - ReferenceAdjustedTracker adj = new ReferenceAdjustedTracker<>(tracker); - adj.resetFull(referenceQuat); + tracker.rotQuaternion.set(trackerQuat); + tracker.resetFull(referenceQuat); // Use only yaw HMD rotation Quaternion targetTrackerRotation = new Quaternion(referenceQuat); @@ -269,7 +276,7 @@ public class ReferenceAdjustmentsTests { TransformNode rotationNode = new TransformNode("Rot", true); rotationNode.attachChild(trackerNode); - trackerNode.localTransform.setRotation(tracker.rotation); + trackerNode.localTransform.setRotation(tracker.rotQuaternion); for (int yaw = 0; yaw <= 360; yaw += 30) { for (int pitch = -90; pitch <= 90; pitch += 15) { @@ -288,10 +295,10 @@ public class ReferenceAdjustmentsTests { ); rotationNode.localTransform.setRotation(rotation); rotationNode.update(); - tracker.rotation.set(trackerNode.worldTransform.getRotation()); - tracker.rotation.toAngles(angles); + tracker.rotQuaternion.set(trackerNode.worldTransform.getRotation()); + tracker.rotQuaternion.toAngles(angles); - adj.getRotation(read); + tracker.getRotation(read); read.toAngles(anglesAdj); diff.set(read).inverseLocal().multLocal(rotationCompare);