File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/main/java/io/eiren/vr/trackers Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,14 @@ public void saveConfig(TrackerConfig config) {
4444 */
4545 @ Override
4646 public void resetFull (Quaternion reference ) {
47- resetYaw (reference );
48-
4947 Quaternion sensorRotation = new Quaternion ();
5048 tracker .getRotation (sensorRotation );
51- adjustmentYaw .mult (sensorRotation , sensorRotation );
52-
53- // Use only yaw HMD rotation
54- Quaternion targetTrackerRotation = new Quaternion (reference );
5549 float [] angles = new float [3 ];
56- targetTrackerRotation .toAngles (angles );
57- targetTrackerRotation .fromAngles (0 , angles [1 ], 0 );
50+ sensorRotation .toAngles (angles );
51+ sensorRotation .fromAngles (angles [0 ], 0 , angles [2 ]);
52+ adjustmentAttachment .set (sensorRotation ).inverseLocal ();
5853
59- adjustmentAttachment . set ( sensorRotation ). inverseLocal (). multLocal ( targetTrackerRotation );
54+ resetYaw ( reference );
6055 }
6156
6257 /**
@@ -76,6 +71,7 @@ public void resetYaw(Quaternion reference) {
7671
7772 Quaternion sensorRotation = new Quaternion ();
7873 tracker .getRotation (sensorRotation );
74+ sensorRotation .multLocal (adjustmentAttachment );
7975
8076 sensorRotation .toAngles (angles );
8177 sensorRotation .fromAngles (0 , angles [1 ], 0 );
You can’t perform that action at this time.
0 commit comments