phaser - v4.0.0-rc.4
    Preparing search index...

    A four-dimensional matrix.

    Adapted from gl-matrix by toji and vecmath by mattdesl

    Index

    Constructors

    Properties

    val: Float32Array

    The matrix values.

    Methods

    • Set the values of this Matrix from the given array.

      Parameters

      • a: number[]

        The array to copy the values from. Must have at least 16 elements.

      Returns this

    • Takes the rotation and position vectors and builds this Matrix4 from them.

      Parameters

      • rotation: Math.Vector3

        The rotation vector.

      • position: Math.Vector3

        The position vector.

      • translateFirst: boolean

        Should the operation translate then rotate (true), or rotate then translate? (false)

      Returns this

    • Generate a frustum matrix with the given bounds.

      Parameters

      • left: number

        The left bound of the frustum.

      • right: number

        The right bound of the frustum.

      • bottom: number

        The bottom bound of the frustum.

      • top: number

        The top bound of the frustum.

      • near: number

        The near bound of the frustum.

      • far: number

        The far bound of the frustum.

      Returns this

    • Returns the maximum axis scale from this Matrix4.

      Returns number

    • Multiply the values of this Matrix4 by those given in the src argument.

      Parameters

      • src: Math.Matrix4

        The source Matrix4 that this Matrix4 is multiplied by.

      Returns this

    • Generate an orthogonal projection matrix with the given bounds.

      Parameters

      • left: number

        The left bound of the frustum.

      • right: number

        The right bound of the frustum.

      • bottom: number

        The bottom bound of the frustum.

      • top: number

        The top bound of the frustum.

      • near: number

        The near bound of the frustum.

      • far: number

        The far bound of the frustum.

      Returns this

    • Generate a perspective projection matrix with the given bounds.

      Parameters

      • fovy: number

        Vertical field of view in radians

      • aspect: number

        Aspect ratio. Typically viewport width /height.

      • near: number

        Near bound of the frustum.

      • far: number

        Far bound of the frustum.

      Returns this

    • Generate a perspective projection matrix with the given bounds.

      Parameters

      • width: number

        The width of the frustum.

      • height: number

        The height of the frustum.

      • near: number

        Near bound of the frustum.

      • far: number

        Far bound of the frustum.

      Returns this

    • Multiplies the given Matrix4 object with this Matrix.

      This is the same as calling multiplyMatrices(m, this).

      Parameters

      Returns this

    • Apply a rotation transformation to this Matrix.

      Parameters

      • rad: number

        The angle in radians to rotate by.

      • axis: Math.Vector3

        The axis to rotate upon.

      Returns this

    • Rotate this matrix on its X axis.

      Parameters

      • rad: number

        The angle in radians to rotate by.

      Returns this

    • Rotate this matrix on its Y axis.

      Parameters

      • rad: number

        The angle to rotate by, in radians.

      Returns this

    • Rotate this matrix on its Z axis.

      Parameters

      • rad: number

        The angle to rotate by, in radians.

      Returns this

    • Apply a scale transformation to this Matrix.

      Parameters

      • x: number

        The x component.

      • y: number

        The y component.

      • z: number

        The z component.

      Returns this

    • Set the scaling values of this Matrix.

      Parameters

      • x: number

        The x scaling value.

      • y: number

        The y scaling value.

      • z: number

        The z scaling value.

      Returns this

    • Sets all values of this Matrix4.

      Parameters

      • m00: number

        The m00 value.

      • m01: number

        The m01 value.

      • m02: number

        The m02 value.

      • m03: number

        The m03 value.

      • m10: number

        The m10 value.

      • m11: number

        The m11 value.

      • m12: number

        The m12 value.

      • m13: number

        The m13 value.

      • m20: number

        The m20 value.

      • m21: number

        The m21 value.

      • m22: number

        The m22 value.

      • m23: number

        The m23 value.

      • m30: number

        The m30 value.

      • m31: number

        The m31 value.

      • m32: number

        The m32 value.

      • m33: number

        The m33 value.

      Returns this

    • Translate this Matrix using the given values.

      Parameters

      • x: number

        The x component.

      • y: number

        The y component.

      • z: number

        The z component.

      Returns this

    • Set the x, y and z values of this Matrix.

      Parameters

      • x: number

        The x value.

      • y: number

        The y value.

      • z: number

        The z value.

      Returns this

    • Set the values of this matrix from the given yaw, pitch and roll values.

      Parameters

      • yaw: number

        The yaw value.

      • pitch: number

        The pitch value.

      • roll: number

        The roll value.

      Returns this