mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-05 08:12:29 -08:00
make front the default mounting orientation (#384)
This commit is contained in:
1 parent
9407c6f0d4
commit
48c35d9a78
3 files changed
+5
-35
No files matched your search
@@ -79,7 +79,10 @@ public class IMUTracker
|
||||
@Override
|
||||
public void writeConfig(TrackerConfig config) {
|
||||
config.setDesignation(bodyPosition == null ? null : bodyPosition.designation);
|
||||
config.setMountingRotation(mounting != null ? mounting : null);
|
||||
config
|
||||
.setMountingRotation(
|
||||
mounting != null ? mounting : new Quaternion().fromAngles(0, FastMath.PI, 0)
|
||||
);
|
||||
config.setCustomName(customName);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package dev.slimevr.vr.trackers;
|
||||
|
||||
import com.jme3.math.FastMath;
|
||||
import com.jme3.math.Quaternion;
|
||||
|
||||
|
||||
public enum TrackerMountingRotation {
|
||||
|
||||
FRONT(180), LEFT(90), BACK(0), RIGHT(-90);
|
||||
|
||||
public static final TrackerMountingRotation[] values = values();
|
||||
public final Quaternion quaternion;
|
||||
|
||||
TrackerMountingRotation(float angle) {
|
||||
this.quaternion = new Quaternion().fromAngles(0, angle * FastMath.DEG_TO_RAD, 0);
|
||||
}
|
||||
|
||||
public static TrackerMountingRotation fromName(String name) {
|
||||
for (TrackerMountingRotation r : values) {
|
||||
if (r.name().equals(name))
|
||||
return r;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static TrackerMountingRotation fromQuaternion(Quaternion q) {
|
||||
for (TrackerMountingRotation r : values) {
|
||||
if (r.quaternion.equals(q))
|
||||
return r;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user