From 2a1b7c6c509d4d19de21abf02b63aeacba269d13 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 16 Jun 2016 23:59:06 -0700 Subject: altoslib: Add null constructors to AltosQuaternion and AltosRotation These will be used in the reflection-based JSON code Signed-off-by: Keith Packard --- altoslib/AltosRotation.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'altoslib/AltosRotation.java') diff --git a/altoslib/AltosRotation.java b/altoslib/AltosRotation.java index 321a0f30..6db0b541 100644 --- a/altoslib/AltosRotation.java +++ b/altoslib/AltosRotation.java @@ -48,14 +48,18 @@ public class AltosRotation implements AltosJsonable { 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; -- cgit v1.2.3