You’re reading the docs for Phaser v3.88.2. The latest is Phaser v4.1.0.

Matrix3

Phaser.Math.Matrix3

A three-dimensional matrix.

Defaults to the identity matrix when instantiated.

Constructor

new Matrix3([m])

Parameters

nametypeoptionaldescription
mPhaser.Math.Matrix3YesOptional Matrix3 to copy values from.

Scope: static

Source: src/math/Matrix3.js#L12
Since: 3.0.0

Public Members

val

val: Float32Array

Description:

The matrix values.

Source: src/math/Matrix3.js#L31
Since: 3.0.0


Public Methods

adjoint

instanceadjoint()

Description:

Calculate the adjoint, or adjugate, of this Matrix.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L262
Since: 3.0.0


clone

instanceclone()

Description:

Make a clone of this Matrix3.

Returns: Phaser.Math.Matrix3 - A clone of this Matrix3.

Source: src/math/Matrix3.js#L52
Since: 3.0.0


copy

instancecopy(src)

Description:

Copy the values of a given Matrix into this Matrix.

Parameters:

nametypeoptionaldescription
srcPhaser.Math.Matrix3NoThe Matrix to copy the values from.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L80
Since: 3.0.0


determinant

instancedeterminant()

Description:

Calculate the determinant of this Matrix.

Returns: number - The determinant of this Matrix.

Source: src/math/Matrix3.js#L297
Since: 3.0.0


fromArray

instancefromArray(a)

Description:

Set the values of this Matrix from the given array.

Parameters:

nametypeoptionaldescription
aarrayNoThe array to copy the values from.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L136
Since: 3.0.0


fromMat4

instancefromMat4(m)

Description:

Copy the values of a given Matrix4 into this Matrix3.

Parameters:

nametypeoptionaldescription
mPhaser.Math.Matrix4NoThe Matrix4 to copy the values from.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L108
Since: 3.0.0


fromQuat

instancefromQuat(q)

Description:

Set the values of this Matrix from the given Quaternion.

Parameters:

nametypeoptionaldescription
qPhaser.Math.QuaternionNoThe Quaternion to set the values of this Matrix from.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L460
Since: 3.0.0


identity

instanceidentity()

Description:

Reset this Matrix to an identity (default) matrix.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L163
Since: 3.0.0


invert

instanceinvert()

Description:

Invert this Matrix.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L213
Since: 3.0.0


multiply

instancemultiply(src)

Description:

Multiply this Matrix by the given Matrix.

Parameters:

nametypeoptionaldescription
srcPhaser.Math.Matrix3NoThe Matrix to multiply this Matrix by.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L322
Since: 3.0.0


normalFromMat4

instancenormalFromMat4(m)

Description:

Set the values of this Matrix3 to be normalized from the given Matrix4.

Parameters:

nametypeoptionaldescription
mPhaser.Math.Matrix4NoThe Matrix4 to normalize the values from.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L510
Since: 3.0.0


rotate

instancerotate(rad)

Description:

Apply a rotation transformation to this Matrix.

Parameters:

nametypeoptionaldescription
radnumberNoThe angle in radians to rotate by.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L396
Since: 3.0.0


scale

instancescale(v)

Description:

Apply a scale transformation to this Matrix.

Uses the x and y components of the given Vector to scale the Matrix.

Parameters:

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L431
Since: 3.0.0


set

instanceset(src)

Description:

This method is an alias for Matrix3.copy.

Parameters:

nametypeoptionaldescription
srcPhaser.Math.Matrix3NoThe Matrix to set the values of this Matrix's from.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L65
Since: 3.0.0


translate

instancetranslate(v)

Description:

Translate this Matrix using the given Vector.

Parameters:

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L373
Since: 3.0.0


transpose

instancetranspose()

Description:

Transpose this Matrix.

Returns: Phaser.Math.Matrix3 - This Matrix3.

Source: src/math/Matrix3.js#L188
Since: 3.0.0