Mac 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 OS X v10.8 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 OS X v10.8 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 OS X v10.8 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 OS X v10.8 and later.

  • Returns a string that represents the contents of a matrix.

    Declaration

    Swift

    func NSStringFromGLKMatrix2(_ matrix: GLKMatrix2) -> String!

    Objective-C

    NSString * NSStringFromGLKMatrix2 ( GLKMatrix2 matrix );

    Parameters

    matrix

    A 2x2 matrix.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • Returns a string that represents the contents of a matrix.

    Declaration

    Swift

    func NSStringFromGLKMatrix3(_ matrix: GLKMatrix3) -> String!

    Objective-C

    NSString * NSStringFromGLKMatrix3 ( GLKMatrix3 matrix );

    Parameters

    matrix

    A 3x3 matrix.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • Returns a string that represents the contents of a matrix.

    Declaration

    Swift

    func NSStringFromGLKMatrix4(_ matrix: GLKMatrix4) -> String!

    Objective-C

    NSString * NSStringFromGLKMatrix4 ( GLKMatrix4 matrix );

    Parameters

    matrix

    A 4x4 matrix.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • Returns a string that represents the contents of a vector.

    Declaration

    Swift

    func NSStringFromGLKVector2(_ vector: GLKVector2) -> String!

    Objective-C

    NSString * NSStringFromGLKVector2 ( GLKVector2 vector );

    Parameters

    vector

    A 2-component vector.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • Returns a string that represents the contents of a vector.

    Declaration

    Swift

    func NSStringFromGLKVector3(_ vector: GLKVector3) -> String!

    Objective-C

    NSString * NSStringFromGLKVector3 ( GLKVector3 vector );

    Parameters

    vector

    A 3-component vector.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • Returns a string that represents the contents of a vector.

    Declaration

    Swift

    func NSStringFromGLKVector4(_ vector: GLKVector4) -> String!

    Objective-C

    NSString * NSStringFromGLKVector4 ( GLKVector4 vector );

    Parameters

    vector

    A 4-component vector.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • Returns a string that represents the contents of a quaternion.

    Declaration

    Swift

    func NSStringFromGLKQuaternion(_ quaternion: GLKQuaternion) -> String!

    Objective-C

    NSString * NSStringFromGLKQuaternion ( GLKQuaternion quaternion );

    Parameters

    quaternion

    A quaternion.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.