mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-21 09:31:20 -08:00
Fix conflicts with main
This commit is contained in:
commit
d0ee364fb9
3 files changed
+19
-5
No files matched your search
@@ -3,6 +3,8 @@ package dev.slimevr.vr.trackers;
|
||||
import com.jme3.math.Quaternion;
|
||||
import io.eiren.yaml.YamlNode;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class TrackerConfig {
|
||||
|
||||
public final String trackerName;
|
||||
@@ -36,7 +38,8 @@ public class TrackerConfig {
|
||||
}
|
||||
|
||||
if (oldMountingRotation != null) {
|
||||
mountingRotation = TrackerMountingRotation.valueOf(oldMountingRotation).quaternion;
|
||||
TrackerMountingRotation rot = TrackerMountingRotation.fromName(oldMountingRotation);
|
||||
mountingRotation = Objects.requireNonNullElse(rot, TrackerMountingRotation.FRONT).quaternion;
|
||||
}
|
||||
|
||||
YamlNode adjNode = node.getNode("adjustment");
|
||||
|
||||
@@ -17,8 +17,16 @@ public enum TrackerMountingRotation {
|
||||
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()) {
|
||||
for (TrackerMountingRotation r : values) {
|
||||
if (r.quaternion.equals(q))
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user