C# Class Afterglow.Math.Quaternion

Represents a rotation in 3d-space with four values (a rotation axis and an angle). http://en.wikipedia.org/wiki/Quaternion
Show file Open project: Christof/afterglow Class Usage Examples

Public Methods

Method Description
Quaternion ( Vector3 vector3 )

Initializes a new instance of the Quaternion class.

Quaternion ( Vector3 sourcePosition, Vector3 destinationPosition )

Initializes a new instance of the Quaternion class.

Quaternion ( Vector3 rotationAxis, float angle )

Initializes a new instance of the Quaternion class.

ToAxisAngle ( ) : Vector4

Returns the axis angle representation in a Vector4. The x, y and z componentes are the axis and w is the angle.

ToMatrix ( ) : Matrix

Converts to quaternion to a rotation matrix.

operator ( ) : Quaternion

Concatenates two quaternions. The right argument is applied first.

Method Details

Quaternion() public method

Initializes a new instance of the Quaternion class.
public Quaternion ( Vector3 vector3 )
vector3 Vector3 The vector which should be represented as quaternion.

Quaternion() public method

Initializes a new instance of the Quaternion class.
public Quaternion ( Vector3 sourcePosition, Vector3 destinationPosition )
sourcePosition Vector3 The source position.
destinationPosition Vector3 The destination position.

Quaternion() public method

Initializes a new instance of the Quaternion class.
public Quaternion ( Vector3 rotationAxis, float angle )
rotationAxis Vector3 The rotation axis.
angle float The angle.

ToAxisAngle() public method

Returns the axis angle representation in a Vector4. The x, y and z componentes are the axis and w is the angle.
public ToAxisAngle ( ) : Vector4
return Vector4

ToMatrix() public method

Converts to quaternion to a rotation matrix.
public ToMatrix ( ) : Matrix
return Matrix

operator() public static method

Concatenates two quaternions. The right argument is applied first.
public static operator ( ) : Quaternion
return Quaternion