iOS Developer Library — Prerelease

Developer

GLKit Framework Reference GLKQuaternion Reference

Options
Deployment Target:

On This Page
Language:

GLKQuaternion Reference

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.

Functions

Data Types

  • A representation of a quaternion.

    Declaration

    Swift

    typealias GLKQuaternion = _GLKQuaternion

    Objective-C

    union _GLKQuaternion { struct { GLKVector3 v; float s; }; struct { float x, y, z, w; }; float q[4]; } typedef union _GLKQuaternion GLKQuaternion;

    Fields

    v

    The vector portion of the quaternion.

    s

    The scalar component of the quaternion.

    x

    The x component of the vector portion of the quaternion.

    y

    The y component of the vector portion of the quaternion.

    z

    The z component of the vector portion of the quaternion.

    w

    The scalar component of the quaternion.

    q

    The components of the quaternion expressed as an array of elements.

    Availability

    Available in iOS 5.0 and later.

Constants

  • An identity quaternion.

    Declaration

    Swift

    let GLKQuaternionIdentity: GLKQuaternion

    Objective-C

    extern const GLKQuaternion GLKQuaternionIdentity;

    Constants

    • GLKQuaternionIdentity

      GLKQuaternionIdentity

      An identity quaternion.

      Available in iOS 5.0 and later.