Phaser API Documentation

  Version: 
Filter

A three-dimensional matrix.

Defaults to the identity matrix when instantiated.

Constructor:

new Matrix3([m])

Parameters:

name type arguments description
m Phaser.Math.Matrix3 <optional>

Optional Matrix3 to copy values from.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 12)

Members

val: Float32Array
Focus
Focus

Description:

The matrix values.

Type:
Float32Array
Since: 3.0.0
Source: src/math/Matrix3.js (Line 31)
Focus
Focus

Methods

adjoint()
Focus
Focus

Description:

Calculate the adjoint, or adjugate, of this Matrix.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 262)
Focus
Focus
clone()
Focus
Focus

Description:

Make a clone of this Matrix3.

Returns:
Description:

A clone of this Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 52)
Focus
Focus
copy(src)
Focus
Focus

Description:

Copy the values of a given Matrix into this Matrix.

Parameters:

name type description
src Phaser.Math.Matrix3

The Matrix to copy the values from.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 80)
Focus
Focus
determinant()
Focus
Focus

Description:

Calculate the determinant of this Matrix.

Returns:
Description:

The determinant of this Matrix.

Type:
  • number
Since: 3.0.0
Source: src/math/Matrix3.js (Line 297)
Focus
Focus
fromArray(a)
Focus
Focus

Description:

Set the values of this Matrix from the given array.

Parameters:

name type description
a array

The array to copy the values from.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 136)
Focus
Focus
fromMat4(m)
Focus
Focus

Description:

Copy the values of a given Matrix4 into this Matrix3.

Parameters:

name type description
m Phaser.Math.Matrix4

The Matrix4 to copy the values from.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 108)
Focus
Focus
fromQuat(q)
Focus
Focus

Description:

Set the values of this Matrix from the given Quaternion.

Parameters:

name type description
q Phaser.Math.Quaternion

The Quaternion to set the values of this Matrix from.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 460)
Focus
Focus
identity()
Focus
Focus

Description:

Reset this Matrix to an identity (default) matrix.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 163)
Focus
Focus
invert()
Focus
Focus

Description:

Invert this Matrix.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 213)
Focus
Focus
multiply(src)
Focus
Focus

Description:

Multiply this Matrix by the given Matrix.

Parameters:

name type description
src Phaser.Math.Matrix3

The Matrix to multiply this Matrix by.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 322)
Focus
Focus
normalFromMat4(m)
Focus
Focus

Description:

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

Parameters:

name type description
m Phaser.Math.Matrix4

The Matrix4 to normalize the values from.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 510)
Focus
Focus
rotate(rad)
Focus
Focus

Description:

Apply a rotation transformation to this Matrix.

Parameters:

name type description
rad number

The angle in radians to rotate by.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 396)
Focus
Focus
scale(v)
Focus
Focus

Description:

Apply a scale transformation to this Matrix.

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

Parameters:

name type description
v Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4

The Vector to scale this Matrix with.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 431)
Focus
Focus
set(src)
Focus
Focus

Description:

This method is an alias for Matrix3.copy.

Parameters:

name type description
src Phaser.Math.Matrix3

The Matrix to set the values of this Matrix's from.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 65)
Focus
Focus
translate(v)
Focus
Focus

Description:

Translate this Matrix using the given Vector.

Parameters:

name type description
v Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4

The Vector to translate this Matrix with.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 373)
Focus
Focus
transpose()
Focus
Focus

Description:

Transpose this Matrix.

Returns:
Description:

This Matrix3.

Since: 3.0.0
Source: src/math/Matrix3.js (Line 188)
Focus
Focus