A four-dimensional matrix.
new Matrix4([m])
name | type | arguments | description |
---|---|---|---|
m | Phaser.Math.Matrix4 | <optional> |
Optional Matrix4 to copy values from. |
The matrix values.
Calculate the adjoint, or adjugate, of this Matrix.
This Matrix4.
Make a clone of this Matrix4.
A clone of this Matrix4.
Copy the values of a given Matrix into this Matrix.
name | type | description |
---|---|---|
src | Phaser.Math.Matrix4 |
The Matrix to copy the values from. |
This Matrix4.
Calculate the determinant of this Matrix.
The determinant of this Matrix.
Set the values of this Matrix from the given array.
name | type | description |
---|---|---|
a | Array.<number> |
The array to copy the values from. Must have at least 16 elements. |
This Matrix4.
Set the values of this Matrix from the given Quaternion.
name | type | description |
---|---|---|
q | Phaser.Math.Quaternion |
The Quaternion to set the values of this Matrix from. |
This Matrix4.
Set the values of this Matrix from the given rotation Quaternion and translation Vector.
name | type | description |
---|---|---|
q | Phaser.Math.Quaternion |
The Quaternion to set rotation from. |
v | Phaser.Math.Vector3 |
The Vector to set translation from. |
This Matrix4.
Takes the rotation and position vectors and builds this Matrix4 from them.
name | type | description |
---|---|---|
rotation | Phaser.Math.Vector3 |
The rotation vector. |
position | Phaser.Math.Vector3 |
The position vector. |
translateFirst | boolean |
Should the operation translate then rotate ( |
This Matrix4.
Generate a frustum matrix with the given bounds.
name | type | description |
---|---|---|
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. |
This Matrix4.
Copies the given Matrix4 into this Matrix and then inverses it.
name | type | description |
---|---|---|
m | Phaser.Math.Matrix4 |
The Matrix4 to invert into this Matrix4. |
This Matrix4.
Returns the maximum axis scale from this Matrix4.
The maximum axis scale.
Reset this Matrix to an identity (default) matrix.
This Matrix4.
Invert this Matrix.
This Matrix4.
Generate a look-at matrix with the given eye position, focal point, and up axis.
name | type | description |
---|---|---|
eye | Phaser.Math.Vector3 |
Position of the viewer |
center | Phaser.Math.Vector3 |
Point the viewer is looking at |
up | Phaser.Math.Vector3 |
vec3 pointing up. |
This Matrix4.
Generate a right-handed look-at matrix with the given eye position, target and up axis.
name | type | description |
---|---|---|
eye | Phaser.Math.Vector3 |
Position of the viewer. |
target | Phaser.Math.Vector3 |
Point the viewer is looking at. |
up | Phaser.Math.Vector3 |
vec3 pointing up. |
This Matrix4.
Derive a rotation matrix around the given axis.
name | type | description |
---|---|---|
axis | Phaser.Math.Vector3 | Phaser.Math.Vector4 |
The rotation axis. |
angle | number |
The rotation angle in radians. |
This Matrix4.
Multiply this Matrix by the given Matrix.
name | type | description |
---|---|---|
src | Phaser.Math.Matrix4 |
The Matrix to multiply this Matrix by. |
This Matrix4.
Multiply the values of this Matrix4 by those given in the src
argument.
name | type | description |
---|---|---|
src | Phaser.Math.Matrix4 |
The source Matrix4 that this Matrix4 is multiplied by. |
This Matrix4.
Multiplies the two given Matrix4 objects and stores the results in this Matrix.
name | type | description |
---|---|---|
a | Phaser.Math.Matrix4 |
The first Matrix4 to multiply. |
b | Phaser.Math.Matrix4 |
The second Matrix4 to multiply. |
This Matrix4.
Multiplies this Matrix4 by the given src
Matrix4 and stores the results in the out
Matrix4.
name | type | description |
---|---|---|
src | Phaser.Math.Matrix4 |
The Matrix4 to multiply with this one. |
out | Phaser.Math.Matrix4 |
The receiving Matrix. |
This out
Matrix4.
Generate an orthogonal projection matrix with the given bounds.
name | type | description |
---|---|---|
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. |
This Matrix4.
Generate a perspective projection matrix with the given bounds.
name | type | description |
---|---|---|
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. |
This Matrix4.
Generate a perspective projection matrix with the given bounds.
name | type | description |
---|---|---|
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. |
This Matrix4.
Multiplies the given Matrix4 object with this Matrix.
This is the same as calling multiplyMatrices(m, this)
.
name | type | description |
---|---|---|
m | Phaser.Math.Matrix4 |
The Matrix4 to multiply with this one. |
This Matrix4.
Apply a rotation transformation to this Matrix.
name | type | description |
---|---|---|
rad | number |
The angle in radians to rotate by. |
axis | Phaser.Math.Vector3 |
The axis to rotate upon. |
This Matrix4.
Rotate this matrix on its X axis.
name | type | description |
---|---|---|
rad | number |
The angle in radians to rotate by. |
This Matrix4.
Rotate this matrix on its Y axis.
name | type | description |
---|---|---|
rad | number |
The angle to rotate by, in radians. |
This Matrix4.
Rotate this matrix on its Z axis.
name | type | description |
---|---|---|
rad | number |
The angle to rotate by, in radians. |
This Matrix4.
Apply a scale transformation to this Matrix.
Uses the x
, y
and z
components of the given Vector to scale the Matrix.
name | type | description |
---|---|---|
v | Phaser.Math.Vector3 | Phaser.Math.Vector4 |
The Vector to scale this Matrix with. |
This Matrix4.
Apply a scale transformation to this Matrix.
name | type | description |
---|---|---|
x | number |
The x component. |
y | number |
The y component. |
z | number |
The z component. |
This Matrix4.
Set the scaling values of this Matrix.
name | type | description |
---|---|---|
x | number |
The x scaling value. |
y | number |
The y scaling value. |
z | number |
The z scaling value. |
This Matrix4.
This method is an alias for Matrix4.copy
.
name | type | description |
---|---|---|
src | Phaser.Math.Matrix4 |
The Matrix to set the values of this Matrix's from. |
This Matrix4.
Sets all values of this Matrix4.
name | type | description |
---|---|---|
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. |
This Matrix4 instance.
Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.
name | type | arguments | description |
---|---|---|---|
rotation | Phaser.Math.Vector3 |
The rotation of the world matrix. |
|
position | Phaser.Math.Vector3 |
The position of the world matrix. |
|
scale | Phaser.Math.Vector3 |
The scale of the world matrix. |
|
viewMatrix | Phaser.Math.Matrix4 | <optional> |
The view matrix. |
projectionMatrix | Phaser.Math.Matrix4 | <optional> |
The projection matrix. |
This Matrix4.
Generates a transform matrix based on the given position, scale and rotation.
name | type | description |
---|---|---|
position | Phaser.Math.Vector3 |
The position vector. |
scale | Phaser.Math.Vector3 |
The scale vector. |
rotation | Phaser.Math.Quaternion |
The rotation quaternion. |
This Matrix4.
Translate this Matrix using the given Vector.
name | type | description |
---|---|---|
v | Phaser.Math.Vector3 | Phaser.Math.Vector4 |
The Vector to translate this Matrix with. |
This Matrix4.
Translate this Matrix using the given values.
name | type | description |
---|---|---|
x | number |
The x component. |
y | number |
The y component. |
z | number |
The z component. |
This Matrix4.
Transpose this Matrix.
This Matrix4.
Set the x
, y
and z
values of this Matrix.
name | type | description |
---|---|---|
x | number |
The x value. |
y | number |
The y value. |
z | number |
The z value. |
This Matrix4.
Set the values of this matrix from the given yaw
, pitch
and roll
values.
name | type | description |
---|---|---|
yaw | number |
The yaw value. |
pitch | number |
The pitch value. |
roll | number |
The roll value. |
This Matrix4.
Reset this Matrix.
Sets all values to 0
.
This Matrix4.