@SuppressWarnings("SuspiciousNameCombination") @Test(expected = IllegalArgumentException.class) public void testSetWorldAxesNotOrthogonal() { WorldParameters.setWorldAxes(Vector3.Y, Vector3.Y, Vector3.X); }
public static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward) { TEMP_VECTOR.crossAndSet(right, up); if (!TEMP_VECTOR.equals(forward, 1e-6)) { throw new IllegalArgumentException("World axes must be orthogonal."); } RIGHT_AXIS.setAll(right); NEG_RIGHT_AXIS.setAll(RIGHT_AXIS).inverse(); UP_AXIS.setAll(up); NEG_UP_AXIS.setAll(UP_AXIS).inverse(); FORWARD_AXIS.setAll(forward); NEG_FORWARD_AXIS.setAll(FORWARD_AXIS).inverse(); }
WorldParameters { public static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward) { TEMP_VECTOR.crossAndSet(right, up); if (!TEMP_VECTOR.equals(forward, 1e-6)) { throw new IllegalArgumentException("World axes must be orthogonal."); } RIGHT_AXIS.setAll(right); NEG_RIGHT_AXIS.setAll(RIGHT_AXIS).inverse(); UP_AXIS.setAll(up); NEG_UP_AXIS.setAll(UP_AXIS).inverse(); FORWARD_AXIS.setAll(forward); NEG_FORWARD_AXIS.setAll(FORWARD_AXIS).inverse(); } }
WorldParameters { public static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward) { TEMP_VECTOR.crossAndSet(right, up); if (!TEMP_VECTOR.equals(forward, 1e-6)) { throw new IllegalArgumentException("World axes must be orthogonal."); } RIGHT_AXIS.setAll(right); NEG_RIGHT_AXIS.setAll(RIGHT_AXIS).inverse(); UP_AXIS.setAll(up); NEG_UP_AXIS.setAll(UP_AXIS).inverse(); FORWARD_AXIS.setAll(forward); NEG_FORWARD_AXIS.setAll(FORWARD_AXIS).inverse(); }  }
WorldParameters { public static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward) { TEMP_VECTOR.crossAndSet(right, up); if (!TEMP_VECTOR.equals(forward, 1e-6)) { throw new IllegalArgumentException("World axes must be orthogonal."); } RIGHT_AXIS.setAll(right); NEG_RIGHT_AXIS.setAll(RIGHT_AXIS).inverse(); UP_AXIS.setAll(up); NEG_UP_AXIS.setAll(UP_AXIS).inverse(); FORWARD_AXIS.setAll(forward); NEG_FORWARD_AXIS.setAll(FORWARD_AXIS).inverse(); }  static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward); }
WorldParameters { public static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward) { TEMP_VECTOR.crossAndSet(right, up); if (!TEMP_VECTOR.equals(forward, 1e-6)) { throw new IllegalArgumentException("World axes must be orthogonal."); } RIGHT_AXIS.setAll(right); NEG_RIGHT_AXIS.setAll(RIGHT_AXIS).inverse(); UP_AXIS.setAll(up); NEG_UP_AXIS.setAll(UP_AXIS).inverse(); FORWARD_AXIS.setAll(forward); NEG_FORWARD_AXIS.setAll(FORWARD_AXIS).inverse(); }  static void setWorldAxes(Vector3 right, Vector3 up, Vector3 forward); static final Vector3 RIGHT_AXIS; static final Vector3 NEG_RIGHT_AXIS; static final Vector3 UP_AXIS; static final Vector3 NEG_UP_AXIS; static final Vector3 FORWARD_AXIS; static final Vector3 NEG_FORWARD_AXIS; }