Class dnx.geom.Quaternion
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.geom.Quaternion

java.lang.Object
   |
   +----dnx.geom.Quaternion

public class Quaternion
extends Object
implements Cloneable, Copyable
Basic quaternion math package.

Variable Index

 o w
 o x
 o y
 o z

Constructor Index

 o Quaternion()
Create a quaternion initialized to zero.
 o Quaternion(float, float, float, float)
 o Quaternion(Quaternion)
Create a new quaternion which is a copy of q.
 o Quaternion(Vector3, float)
Create a new quaternion representing a 3D rotation about the origin.

Method Index

 o add(Quaternion)
 o add(Quaternion, Quaternion)
 o clear()
 o clone()
 o conjugate()
Set the quaternion to its conjugate.
 o conjugate(Quaternion)
Set the quaternion to conjugate of q.
 o copy(Copyable)
 o dot(Quaternion)
Compute the dot product of this quaternion with another; this quantity is the cosine of the angle between two unit quaternions.
 o equals(Object)
 o multiply(Quaternion, Quaternion)
Set the value to the quaternion product q1 * q2
 o negate()
 o normalize()
Normalize the quaternion.
 o normalize(Quaternion)
Set the quaternion to the normalized value of q.
 o postMultiply(Quaternion)
Set the quaternion to the quaternion product of q and itself.
 o preMultiply(Quaternion)
Set the quaternion to the quaternion product of itself and q.
 o rotation(float, float, float, float)
Compute the unit quaternion representing the 3D rotation of angle radians about the origin, through the axis (ax, ay, az) (ax, ay, az) should be a unit vector.
 o rotation(Vector3, float)
Compute the unit quaternion representing the 3D rotation of angle radians about the origin, through axis.
 o setValue(float, float, float, float)
 o subtract(Quaternion)
 o subtract(Quaternion, Quaternion)
 o toAxisAngle(Vector3)
Convert a unit quaternion to an axis-angle 3D rotation.
 o toString()

Variables

 o x
  public float x
 o y
  public float y
 o z
  public float z
 o w
  public float w

Constructors

 o Quaternion
  public Quaternion()
Create a quaternion initialized to zero.
 o Quaternion
  public Quaternion(float x,
                    float y,
                    float z,
                    float w)
 o Quaternion
  public Quaternion(Quaternion q)
Create a new quaternion which is a copy of q.
 o Quaternion
  public Quaternion(Vector3 axis,
                    float angle)
Create a new quaternion representing a 3D rotation about the origin.

Methods

 o clear
  public void clear()
 o setValue
  public void setValue(float x,
                       float y,
                       float z,
                       float w)
 o add
  public final void add(Quaternion q)
 o add
  public void add(Quaternion q,
                  Quaternion r)
 o subtract
  public void subtract(Quaternion q)
 o subtract
  public void subtract(Quaternion q,
                       Quaternion r)
 o multiply
  public void multiply(Quaternion q1,
                       Quaternion q2)
Set the value to the quaternion product q1 * q2
 o preMultiply
  public final void preMultiply(Quaternion q)
Set the quaternion to the quaternion product of itself and q.
 o postMultiply
  public final void postMultiply(Quaternion q)
Set the quaternion to the quaternion product of q and itself.
 o dot
  public final float dot(Quaternion q)
Compute the dot product of this quaternion with another; this quantity is the cosine of the angle between two unit quaternions.
 o normalize
  public final float normalize()
Normalize the quaternion. The value returned is the magnitude of the quaternion before normalization. @exception NormalizationException if the quaternion is zero.
 o normalize
  public final float normalize(Quaternion q)
Set the quaternion to the normalized value of q. The value returned is the magnitude of q before normalization. @exception NormalizationException if q is zero.
 o negate
  public final void negate()
 o conjugate
  public final void conjugate()
Set the quaternion to its conjugate.
 o conjugate
  public final void conjugate(Quaternion q)
Set the quaternion to conjugate of q.
 o rotation
  public final void rotation(float ax,
                             float ay,
                             float az,
                             float angle)
Compute the unit quaternion representing the 3D rotation of angle radians about the origin, through the axis (ax, ay, az) (ax, ay, az) should be a unit vector.
 o rotation
  public final void rotation(Vector3 axis,
                             float angle)
Compute the unit quaternion representing the 3D rotation of angle radians about the origin, through axis. @param axis axis is a unit vector
 o toAxisAngle
  public final float toAxisAngle(Vector3 axis)
Convert a unit quaternion to an axis-angle 3D rotation. The return value is an angle between -PI and +PI, and the axis of rotation is placed into axis. This method will only work properly for unit quaternions. AXIS is can be null, if you're not interested in the axis value.
 o equals
  public boolean equals(Object obj)
Overrides:
equals in class Object
 o copy
  public void copy(Copyable cop)
 o clone
  public Object clone()
Overrides:
clone in class Object
 o toString
  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index