iOS Developer Library

Developer

GLKit Framework Reference GLKMatrixStack Reference

Options
Deployment Target:

On This Page
Language:

GLKMatrixStack Reference

The GLKMatrixStack type defines an opaque Core Foundation type that provides a stack of 4x4 matrices. A stack of matrices allows your application to push a new matrix on the top of the stack, manipulate it, use it to render geometry, and then pop it off the stack to restore the previous matrix. This behavior is useful when implementing hierarchical animation systems.

Functions

  • Replaces the contents of the top matrix with a new matrix.

    Declaration

    Swift

    func GLKMatrixStackLoadMatrix4(_ stack: GLKMatrixStack, _ matrix: GLKMatrix4)

    Objective-C

    void GLKMatrixStackLoadMatrix4 ( GLKMatrixStackRef stack, GLKMatrix4 matrix );

    Parameters

    stack

    A matrix stack.

    matrix

    The matrix whose contents should be loaded onto the stack.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by multiplying the contents of the top matrix by another matrix.

    Declaration

    Swift

    func GLKMatrixStackMultiplyMatrix4(_ stack: GLKMatrixStack, _ matrix: GLKMatrix4)

    Objective-C

    void GLKMatrixStackMultiplyMatrix4 ( GLKMatrixStackRef stack, GLKMatrix4 matrix );

    Parameters

    stack

    A matrix stack.

    matrix

    The matrix multiplicand.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by multiplying the contents of the top matrix by the top matrix of another matrix stack.

    Declaration

    Swift

    func GLKMatrixStackMultiplyMatrixStack(_ stackLeft: GLKMatrixStack, _ stackRight: GLKMatrixStack)

    Objective-C

    void GLKMatrixStackMultiplyMatrixStack ( GLKMatrixStackRef stackLeft, GLKMatrixStackRef stackRight );

    Parameters

    stackLeft

    A matrix stack to modify.

    stackRight

    A matrix stack whose top matrix is to be used as the multiplicand.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

    Declaration

    Swift

    func GLKMatrixStackRotate(_ stack: GLKMatrixStack, _ radians: Float, _ x: Float, _ y: Float, _ z: Float)

    Objective-C

    void GLKMatrixStackRotate ( GLKMatrixStackRef stack, float radians, float x, float y, float z );

    Parameters

    stack

    A matrix stack.

    radians

    The angle of the rotation (a positive angle is counterclockwise).

    x

    The x coordinate of the rotation axis.

    y

    The y coordinate of the rotation axis.

    z

    The z coordinate of the rotation axis.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

    Declaration

    Swift

    func GLKMatrixStackRotateWithVector3(_ stack: GLKMatrixStack, _ radians: Float, _ axisVector: GLKVector3)

    Objective-C

    void GLKMatrixStackRotateWithVector3 ( GLKMatrixStackRef stack, float radians, GLKVector3 axisVector );

    Parameters

    stack

    A matrix stack.

    radians

    The angle of the rotation (a positive angle is counterclockwise).

    axisVector

    A vector whose x,y and z coordinates are used as the axis of rotation.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

    Declaration

    Swift

    func GLKMatrixStackRotateWithVector4(_ stack: GLKMatrixStack, _ radians: Float, _ axisVector: GLKVector4)

    Objective-C

    void GLKMatrixStackRotateWithVector4 ( GLKMatrixStackRef stack, float radians, GLKVector4 axisVector );

    Parameters

    stack

    A matrix stack.

    radians

    The angle of the rotation (a positive angle is counterclockwise).

    axisVector

    A vector whose x,y and z coordinates are used as the axis of rotation.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around the positive-x axis.

    Declaration

    Swift

    func GLKMatrixStackRotateX(_ stack: GLKMatrixStack, _ radians: Float)

    Objective-C

    void GLKMatrixStackRotateX ( GLKMatrixStackRef stack, float radians );

    Parameters

    stack

    A matrix stack.

    radians

    The angle of the rotation (a positive angle is counterclockwise).

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around the positive-y axis.

    Declaration

    Swift

    func GLKMatrixStackRotateY(_ stack: GLKMatrixStack, _ radians: Float)

    Objective-C

    void GLKMatrixStackRotateY ( GLKMatrixStackRef stack, float radians );

    Parameters

    stack

    A matrix stack.

    radians

    The angle of the rotation (a positive angle is counterclockwise).

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around the positive-z axis.

    Declaration

    Swift

    func GLKMatrixStackRotateZ(_ stack: GLKMatrixStack, _ radians: Float)

    Objective-C

    void GLKMatrixStackRotateZ ( GLKMatrixStackRef stack, float radians );

    Parameters

    stack

    A matrix stack.

    radians

    The angle of the rotation (a positive angle is counterclockwise).

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by scaling the contents of the top matrix.

    Declaration

    Swift

    func GLKMatrixStackScale(_ stack: GLKMatrixStack, _ sx: Float, _ sy: Float, _ sz: Float)

    Objective-C

    void GLKMatrixStackScale ( GLKMatrixStackRef stack, float sx, float sy, float sz );

    Parameters

    stack

    A matrix stack.

    sx

    The scaling factor used to modify the x components.

    sy

    The scaling factor used to modify the y components.

    sz

    The scaling factor used to modify the z components.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a scaling operation.

    Declaration

    Swift

    func GLKMatrixStackScaleWithVector3(_ stack: GLKMatrixStack, _ scaleVector: GLKVector3)

    Objective-C

    void GLKMatrixStackScaleWithVector3 ( GLKMatrixStackRef stack, GLKVector3 scaleVector );

    Parameters

    stack

    A matrix stack.

    scaleVector

    A vector whose x,y and z components are used to scale the matrix.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a scaling operation defined by a vector.

    Declaration

    Swift

    func GLKMatrixStackScaleWithVector4(_ stack: GLKMatrixStack, _ scaleVector: GLKVector4)

    Objective-C

    void GLKMatrixStackScaleWithVector4 ( GLKMatrixStackRef stack, GLKVector4 scaleVector );

    Parameters

    stack

    A matrix stack.

    scaleVector

    A vector whose x,y and z components are used to scale the matrix.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a translation operation.

    Declaration

    Swift

    func GLKMatrixStackTranslate(_ stack: GLKMatrixStack, _ tx: Float, _ ty: Float, _ tz: Float)

    Objective-C

    void GLKMatrixStackTranslate ( GLKMatrixStackRef stack, float tx, float ty, float tz );

    Parameters

    stack

    A matrix stack.

    tx

    The amount to translate the position along the x-axis.

    ty

    The amount to translate the position along the y-axis.

    tz

    The amount to translate the position along the z-axis.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a translation defined by a vector.

    Declaration

    Swift

    func GLKMatrixStackTranslateWithVector3(_ stack: GLKMatrixStack, _ translationVector: GLKVector3)

    Objective-C

    void GLKMatrixStackTranslateWithVector3 ( GLKMatrixStackRef stack, GLKVector3 translationVector );

    Parameters

    stack

    A matrix stack.

    translationVector

    A vector whose x,y and z components are used to translate the matrix.

    Availability

    Available in iOS 5.0 and later.

  • Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a translation defined by a vector.

    Declaration

    Swift

    func GLKMatrixStackTranslateWithVector4(_ stack: GLKMatrixStack, _ translationVector: GLKVector4)

    Objective-C

    void GLKMatrixStackTranslateWithVector4 ( GLKMatrixStackRef stack, GLKVector4 translationVector );

    Parameters

    stack

    A matrix stack.

    translationVector

    A vector whose x,y and z components are used to translate the matrix.

    Availability

    Available in iOS 5.0 and later.

Data Types

  • An opaque type that represents a stack of 4x4 matrices.

    Declaration

    Swift

    class GLKMatrixStack { }

    Objective-C

    typedef struct _GLKMatrixStack *GLKMatrixStackRef;

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.