These will be used in the reflection-based JSON code
Signed-off-by: Keith Packard <keithp@keithp.com>
}
public AltosQuaternion(AltosQuaternion q) {
- this.r = q.r;
- this.x = q.x;
- this.y = q.y;
- this.z = q.z;
+ r = q.r;
+ x = q.x;
+ y = q.y;
+ z = q.z;
+ }
+
+ public AltosQuaternion() {
+ r = 1;
+ x = 0;
+ y = 0;
+ z = 0;
}
static public AltosQuaternion vector(double x, double y, double z) {
rotation = up.vectors_to_rotation(orient);
}
- public AltosJson json() {
- return rotation.json();
- }
-
public AltosRotation(AltosJson j) {
rotation = new AltosQuaternion(j);
}
+ public AltosRotation() {
+ rotation = new AltosQuaternion();
+ }
+
+ public AltosJson json() {
+ return rotation.json();
+ }
+
public static AltosRotation fromJson(AltosJson j, AltosRotation def) {
if (j == null)
return def;