/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param direction Direction of the orbit. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, double angle, OrbitDirection direction) { this(focalPoint, periapsis, Vector3.getAxisVector(Axis.Y), eccentricity, angle, direction); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param axis Axis of the orbit. * @param angle Degrees to rotate. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, Axis axis, double angle) { this(focalPoint, periapsis, Vector3.getAxisVector(axis), eccentricity, angle); } /**
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param direction Direction of the orbit. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, OrbitDirection direction) { this(focalPoint, periapsis, Vector3.getAxisVector(Axis.Y), eccentricity, direction); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param angle Degrees to rotate. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, double angle) { this(focalPoint, periapsis, Vector3.getAxisVector(Axis.Y), eccentricity, angle); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param axis Axis of the orbit. * @param direction Direction of the orbit. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, double angle, Axis axis, OrbitDirection direction) { this(focalPoint, periapsis, Vector3.getAxisVector(axis), eccentricity, angle, direction); }
public RotateOnAxisAnimation(Axis axis, double rotateFrom, double degreesToRotate) { this(Vector3.getAxisVector(axis), rotateFrom, degreesToRotate); }
/** * Sets all components of this {@link Vector3} to the values provided representing * the input {@link Axis}. * * @param axis {@link Axis} The cardinal axis to set the values to. * * @return A reference to this {@link Vector3} to facilitate chaining. */ @NonNull public Vector3 setAll(@NonNull Axis axis) { return setAll(getAxisVector(axis)); }
/** * Sets this {@link Quaternion}'s components from the given axis and angle around the axis. * * @param axis {@link Axis} The cardinal axis to set rotation on. * @param angle double The rotation angle in degrees. * * @return A reference to this {@link Quaternion} to facilitate chaining. */ @NonNull public Quaternion fromAngleAxis(@NonNull Axis axis, double angle) { fromAngleAxis(Vector3.getAxisVector(axis), angle); return this; }
@Test(expected = NullPointerException.class) public void testGetAxisVectorWithNull() { Vector3.getAxisVector(null); }
/** * Resets the up axis for this {@link ATransformable3D} object to the +Y axis. * If this is part of a scene graph, the graph will be notified of the change. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D resetUpAxis() { mUpAxis.setAll(Vector3.getAxisVector(Vector3.Axis.Y)); if (mLookAtEnabled && mLookAtValid) { mOrientation.lookAt(mLookAt, mUpAxis); markModelMatrixDirty(); } return this; }
public RotateAnimation3D(double xRotate, double yRotate, double zRotate) { super(); mQuat = Quaternion.getIdentity(); mQuatFrom = new Quaternion(); mRotateX = xRotate; mRotateY = yRotate; mRotateZ = zRotate; mQuat.multiply(new Quaternion().fromAngleAxis(Vector3.getAxisVector(Axis.Y), yRotate)); mQuat.multiply(new Quaternion().fromAngleAxis(Vector3.getAxisVector(Axis.Z), zRotate)); mQuat.multiply(new Quaternion().fromAngleAxis(Vector3.getAxisVector(Axis.X), xRotate)); }
@Test public void testGetAxisVector() { assertEquals(Vector3.X, Vector3.getAxisVector(Vector3.Axis.X)); assertEquals(Vector3.Y, Vector3.getAxisVector(Vector3.Axis.Y)); assertEquals(Vector3.Z, Vector3.getAxisVector(Vector3.Axis.Z)); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param angle Degrees to rotate. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, double angle) { this(focalPoint, periapsis, Vector3.getAxisVector(Axis.Y), eccentricity, angle); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param axis Axis of the orbit. * @param direction Direction of the orbit. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, double angle, Axis axis, OrbitDirection direction) { this(focalPoint, periapsis, Vector3.getAxisVector(axis), eccentricity, angle, direction); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param axis Axis of the orbit. * @param angle Degrees to rotate. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, Axis axis, double angle) { this(focalPoint, periapsis, Vector3.getAxisVector(axis), eccentricity, angle); } /**
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param direction Direction of the orbit. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, OrbitDirection direction) { this(focalPoint, periapsis, Vector3.getAxisVector(Axis.Y), eccentricity, direction); }
/** * Defines an elliptical orbit around a point with no orbital inclination. * * @param focalPoint Point which the {@link ATransformable3D} orbits around. * @param periapsis Point which the object passes closest to the focal point. * @param eccentricity Eccentricity of the orbit. Zero value results in a circular orbit. * @param direction Direction of the orbit. */ public EllipticalOrbitAnimation3D(Vector3 focalPoint, Vector3 periapsis, double eccentricity, double angle, OrbitDirection direction) { this(focalPoint, periapsis, Vector3.getAxisVector(Axis.Y), eccentricity, angle, direction); }
/** * Sets this {@link Quaternion}'s components from the given axis and angle around the axis. * * @param axis {@link Axis} The cardinal axis to set rotation on. * @param angle double The rotation angle in degrees. * @return A reference to this {@link Quaternion} to facilitate chaining. */ public Quaternion fromAngleAxis(final Axis axis, final double angle) { fromAngleAxis(Vector3.getAxisVector(axis), angle); return this; }
/** * Sets all components of this {@link Vector3} to the values provided representing * the input {@link Axis}. * * @param axis {@link Axis} The cardinal axis to set the values to. * * @return A reference to this {@link Vector3} to facilitate chaining. */ public Vector3 setAll(Axis axis) { return setAll(getAxisVector(axis)); }
public RotateAnimation3D(double xRotate, double yRotate, double zRotate) { super(); mQuat = Quaternion.getIdentity(); mQuatFrom = new Quaternion(); mRotateX = xRotate; mRotateY = yRotate; mRotateZ = zRotate; mQuat.multiply(new Quaternion().fromAngleAxis(Vector3.getAxisVector(Axis.Y), yRotate)); mQuat.multiply(new Quaternion().fromAngleAxis(Vector3.getAxisVector(Axis.Z), zRotate)); mQuat.multiply(new Quaternion().fromAngleAxis(Vector3.getAxisVector(Axis.X), xRotate)); }