org.jagatoo.loaders.models.collada
Class Rotations

java.lang.Object
  extended by org.jagatoo.loaders.models.collada.Rotations

public class Rotations
extends java.lang.Object

Rotations utility functions.


Method Summary
static org.openmali.vecmath2.Tuple3f toEuler(org.openmali.vecmath2.Quaternion4f quaternion)
          Converts a Quaternion to Euler angles (in radians).
static org.openmali.vecmath2.Quaternion4f toQuaternion(float rotX, float rotY, float rotZ)
          Converts Euler angles (in radians) to a (normalized) Quaternion.
static org.openmali.vecmath2.Quaternion4f toQuaternion(float rotX, float rotY, float rotZ, org.openmali.vecmath2.Quaternion4f quat)
          Converts Euler angles (in radians) to a (normalized) Quaternion.
static org.openmali.vecmath2.Quaternion4f toQuaternion(org.openmali.vecmath2.Tuple3f tup)
          Converts Euler angles (in radians) to a (normalized) Quaternion.
static org.openmali.vecmath2.Quaternion4f toQuaternion(org.openmali.vecmath2.Tuple3f tup, org.openmali.vecmath2.Quaternion4f quat)
          Converts Euler angles (in radians) to a (normalized) Quaternion.
static org.openmali.vecmath2.Quaternion4f toQuaternion(org.openmali.vecmath2.Vector3f axis, float angle)
          Converts an AxisAngle representation to a Quaternion representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toQuaternion

public static org.openmali.vecmath2.Quaternion4f toQuaternion(float rotX,
                                                              float rotY,
                                                              float rotZ,
                                                              org.openmali.vecmath2.Quaternion4f quat)
Converts Euler angles (in radians) to a (normalized) Quaternion.

Parameters:
rotX - Rotation about the X axis, in degrees
rotY - Rotation about the Y axis, in degrees
rotZ - Rotation about the Z axis, in degrees
quat - destiny quaternion
Returns:
the given quaternion with complete with the values.

toQuaternion

public static org.openmali.vecmath2.Quaternion4f toQuaternion(float rotX,
                                                              float rotY,
                                                              float rotZ)
Converts Euler angles (in radians) to a (normalized) Quaternion.

Parameters:
rotX - Rotation about the X axis, in degrees
rotY - Rotation about the Y axis, in degrees
rotZ - Rotation about the Z axis, in degrees
Returns:
The Quaternion representing the same rotation.

toQuaternion

public static org.openmali.vecmath2.Quaternion4f toQuaternion(org.openmali.vecmath2.Tuple3f tup)
Converts Euler angles (in radians) to a (normalized) Quaternion.

Parameters:
tup - rotation values
Returns:
The Quaternion representing the same rotation.

toQuaternion

public static org.openmali.vecmath2.Quaternion4f toQuaternion(org.openmali.vecmath2.Tuple3f tup,
                                                              org.openmali.vecmath2.Quaternion4f quat)
Converts Euler angles (in radians) to a (normalized) Quaternion.

Parameters:
tup - rotation values
quat - destiny quaternion
Returns:
the given quaternion with complete with the values.

toEuler

public static org.openmali.vecmath2.Tuple3f toEuler(org.openmali.vecmath2.Quaternion4f quaternion)
Converts a Quaternion to Euler angles (in radians). Note : the Quaternion can be non-normalized.

Parameters:
quaternion - The quaternion
Returns:
The euler angles (in radians).

toQuaternion

public static org.openmali.vecmath2.Quaternion4f toQuaternion(org.openmali.vecmath2.Vector3f axis,
                                                              float angle)
Converts an AxisAngle representation to a Quaternion representation. Credits goes to euclideanspace.com author.

Parameters:
axis - The axis. Must be unit-length
angle - The angle, in degrees
Returns:
the rotation quaternion.