iOS Developer Library

Developer

GLKit Framework Reference GLKit Math Utilities

Options
Deployment Target:

On This Page
Language:

GLKit Math Utilities

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import GLKit

Objective-C

@import GLKit;

This reference includes math routines without a specific type associated with them.

Functions

  • Converts an angle measured in degrees to radians.

    Declaration

    Swift

    func GLKMathDegreesToRadians(_ degrees: Float) -> Float

    Objective-C

    float GLKMathDegreesToRadians ( float degrees );

    Parameters

    degrees

    An angle in degrees.

    Return Value

    The converted angle in radians.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Converts an angle measured in radians to degrees.

    Declaration

    Swift

    func GLKMathRadiansToDegrees(_ radians: Float) -> Float

    Objective-C

    float GLKMathRadiansToDegrees ( float radians );

    Parameters

    radians

    An angle in radians.

    Return Value

    The converted angle in degrees.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Projects a point in object space into the window coordinate system.

    Declaration

    Swift

    func GLKMathProject(_ object: GLKVector3, _ model: GLKMatrix4, _ projection: GLKMatrix4, _ viewport: UnsafeMutablePointer<Int32>) -> GLKVector3

    Objective-C

    GLKVector3 GLKMathProject ( GLKVector3 object, GLKMatrix4 model, GLKMatrix4 projection, int *viewport );

    Parameters

    object

    The point in object space.

    model

    A modelview transformation matrix.

    projection

    A projection matrix.

    viewport

    A pointer to an array of four integer values. The first pair of values represent the window coordinates of the viewport’s bottom left corner. The second pair of values represent the width and height of the view port.

    Return Value

    The projected point in window coordinates.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Projects a point in view space into object space.

    Declaration

    Swift

    func GLKMathUnproject(_ window: GLKVector3, _ model: GLKMatrix4, _ projection: GLKMatrix4, _ viewport: UnsafeMutablePointer<Int32>, _ success: UnsafeMutablePointer<Bool>) -> GLKVector3

    Objective-C

    GLKVector3 GLKMathUnproject ( GLKVector3 window, GLKMatrix4 model, GLKMatrix4 projection, int *viewport, bool *success );

    Parameters

    window

    The point in window coordinates.

    model

    A modelview transformation matrix.

    projection

    A projection matrix.

    viewport

    A pointer to an array of four integer values. The first pair of values represent the window coordinates of the viewport’s bottom left corner. The second pair of values represent the width and height of the view port.

    success

    Upon return, contains YEStrue if the function completed successfully, otherwise it contains NOfalse. Pass NULL if you do not want error information.

    Return Value

    The projected point in object space.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.