package org.altusmetrum.altoslib_11;
-public class AltosRotation implements AltosHashable {
+public class AltosRotation implements AltosHashable, AltosJsonable {
private AltosQuaternion rotation;
public double tilt() {
return h;
}
+ public AltosJson json() {
+ return rotation.json();
+ }
+
public AltosRotation(AltosHashSet h) {
rotation = new AltosQuaternion(h.getHash("rotation"));
}
return new AltosRotation(h);
}
+
+ public AltosRotation(AltosJson j) {
+ rotation = new AltosQuaternion(j);
+ }
+
+ public static AltosRotation fromJson(AltosJson j, AltosRotation def) {
+ if (j == null)
+ return def;
+
+ return new AltosRotation(j);
+ }
}