GLKQuaternion

Overview

The GLKQuaternion type defines a structure that represents a quaternion. A quaternion is defined by a scalar component s and an XYZ vector v. Quaternions are often used in graphics programming as a compact representation of a rotation of an object in three dimensions.

The functions that manipulate GLKQuaternion structures treat the inputs as immutable, instead returning a new quaternion that represent the results of the operation.

Topics

Creating Quaternions

GLKQuaternionMake

Returns a quaternion created from its separate components.

GLKQuaternionMakeWithArray

Returns a quaternion created from an array of components.

GLKQuaternionMakeWithVector3

Returns a quaternion created from a vector and a scalar.

GLKQuaternionMakeWithAngleAndAxis

Creates a quaternion that represents a rotation around an axis.

GLKQuaternionMakeWithAngleAndVector3Axis

Creates a quaternion that represents a rotation around an axis.

GLKQuaternionMakeWithMatrix3

Creates a quaternion from a rotation matrix.

GLKQuaternionMakeWithMatrix4

Creates a quaternion from a rotation matrix.

Retrieving Information About a Quaternion

GLKQuaternionLength

Returns the length of a quaternion.

GLKQuaternionAxis

Returns the axis of rotation of a quaternion.

GLKQuaternionAngle

Returns the rotation angle of a quaternion.

Performing Mathematical Operations on Quaternions

GLKQuaternionNormalize

Returns a normalized version of a quaternion.

GLKQuaternionInvert

Returns an inverse of a quaternion.

GLKQuaternionConjugate

Returns the conjugate of a quaternion.

GLKQuaternionAdd

Returns the sum of two quaternions.

GLKQuaternionSubtract

Returns the difference between two quaternions.

GLKQuaternionMultiply

Returns the product of two quaternions.

GLKQuaternionSlerp

Returns the spherical linear interpolation of two quaternions.

Applying Quaternions to Vectors

GLKQuaternionRotateVector3

Returns a new vector that is calculated by applying a quaternion rotation to a vector.

GLKQuaternionRotateVector3Array

Applies a quaternion rotation to an array of vectors.

GLKQuaternionRotateVector4

Returns a new vector calculated by applying a quaternion rotation to a vector.

GLKQuaternionRotateVector4Array

Applies a quaternion rotation to an array of vectors.

Data Types

GLKQuaternion

A representation of a quaternion.

Constants

See Also

Math Utilties

GLKMatrixStackRef

An opaque type that represents a stack of 4 x 4 matrices, providing support for hierarchical transform modeling and similar tasks.