Packagegraphics.geom
Classpublic class Quaternions
InheritanceQuaternions Inheritance Object

Manipulates and transforms Quaternion references.



Public Methods
 MethodDefined By
  
[static] Adds the values of the two specified Quaternion.
Quaternions
  
[static] Returns a new Quaternion conjugate of the specified Quaternion.
Quaternions
  
[static] Returns the multiplication of two Quaternions.
Quaternions
  
[static] Returns the multiplication of one Quaternions with a Vector3.
Quaternions
  
Transform a Quaternion to a Matrix4 object.
Quaternions
  
setByMatrix(matrix:Matrix4, quaternion:Quaternion = null):Quaternion
[static] Sets the specified Quaternion with the Matrix4 reference passed in argument.
Quaternions
  
slerp(q1:Quaternion, q2:Quaternion, t:Number = 0):Quaternion
[static] Interpolates between two quaternions, using spherical linear interpolation (SLERP).
Quaternions
  
[static] Substracts the values of the two specified Quaternion.
Quaternions
Method Detail
add()method
public static function add(q1:Quaternion, q2:Quaternion):Quaternion

Adds the values of the two specified Quaternion.

Parameters

q1:Quaternion — The first quaternion.
 
q2:Quaternion — The second quaternion.

Returns
Quaternion — The new Quaternion.
getConjugate()method 
public static function getConjugate(q:Quaternion):Quaternion

Returns a new Quaternion conjugate of the specified Quaternion.

Parameters

q:Quaternion

Returns
Quaternion — a new Quaternion conjugate of the specified Quaternion.
getMultiply()method 
public static function getMultiply(q1:Quaternion, q2:Quaternion):Quaternion

Returns the multiplication of two Quaternions.

Parameters

q1:Quaternion
 
q2:Quaternion

Returns
Quaternion — the multiplication of two Quaternions.
getMultiplyVector3()method 
public static function getMultiplyVector3(q:Quaternion, v:Vector3):Quaternion

Returns the multiplication of one Quaternions with a Vector3.

Parameters

q:Quaternion
 
v:Vector3

Returns
Quaternion — the multiplication of one Quaternions with a Vector3.
getRotationMatrix()method 
public function getRotationMatrix(q:Quaternion):Matrix4

Transform a Quaternion to a Matrix4 object. Calculates the rotation matrix of the quaternion.

Parameters

q:Quaternion — The Quaternion to transform.

Returns
Matrix4 — The rotation matrix of the specified Quaternion.
setByMatrix()method 
public static function setByMatrix(matrix:Matrix4, quaternion:Quaternion = null):Quaternion

Sets the specified Quaternion with the Matrix4 reference passed in argument.

Parameters

matrix:Matrix4 — the Matrix4 reference used to fill the Quaternion.
 
quaternion:Quaternion (default = null) — the option Quaternion reference to set. If parameter value is null a new Quaternion is created.

Returns
Quaternion
slerp()method 
public static function slerp(q1:Quaternion, q2:Quaternion, t:Number = 0):Quaternion

Interpolates between two quaternions, using spherical linear interpolation (SLERP).

See the wikipedia page about : SLERP.

Parameters

q1:Quaternion — The first quaternion.
 
q2:Quaternion — The second quaternion.
 
t:Number (default = 0) — the amount (between 0 and 1) to interpolate between the two quaternions.

Returns
Quaternion — The interpolated quaternion with the spherical linear interpolation.
substract()method 
public static function substract(q1:Quaternion, q2:Quaternion):Quaternion

Substracts the values of the two specified Quaternion.

Parameters

q1:Quaternion — The first quaternion.
 
q2:Quaternion — The second quaternion.

Returns
Quaternion — The new Quaternion.