mat4
ClassA 4x4 matrix.
- Available on all platforms
Index
Properties
Methods
- add
- compMult
- compose
- determinant
- div
- equal
- extractEulerAngles
- fromColumns
- fromEulerAngles
- fromEulerX
- fromEulerY
- fromEulerZ
- fromRotation
- fromRows
- fromScale
- fromTranslation
- identity
- inverse
- lookAt
- makeBasis
- mult
- multiplyDirection
- multiplyPoint
- multiplyScalar
- multiplyVector
- orthographic
- outerProduct
- perspective
- sub
- toString
- transpose
- zero
Constructors
Constructor
new mat4():
mat4
Returns
mat4
Properties
column0
column0:
vec4
The first column of the matrix.
column1
column1:
vec4
The second column of the matrix.
column2
column2:
vec4
The third column of the matrix.
column3
column3:
vec4
The fourth column of the matrix.
description
description:
string
Returns a string representation of the matrix.
Methods
add()
add(
mat):mat4
Returns the result of adding the two matrices together.
Parameters
| Parameter | Type |
|---|---|
mat | mat4 |
Returns
mat4
compMult()
staticcompMult(a,b):mat4
Returns the two matrices multiplied component-wise.
Parameters
| Parameter | Type |
|---|---|
a | mat4 |
b | mat4 |
Returns
mat4
compose()
staticcompose(translation,rotation,scale):mat4
Returns a new matrix with translation translation, rotation rotation, and scale scale.
Parameters
Returns
mat4
determinant()
determinant():
number
Returns the determinant of the matrix.
Returns
number
div()
div(
mat):mat4
Returns the result of dividing the two matrices.
Parameters
| Parameter | Type |
|---|---|
mat | mat4 |
Returns
mat4
equal()
equal(
mat):boolean
Returns whether the two matrices are equal.
Parameters
| Parameter | Type |
|---|---|
mat | mat4 |
Returns
boolean
extractEulerAngles()
extractEulerAngles():
vec3
Returns an euler angle representation of this matrix's rotation, in radians.
Returns
fromColumns()
staticfromColumns(column0,column1,column2,column3):mat4
Create a 4x4 matrix from four column vectors.
Parameters
Returns
mat4
fromEulerAngles()
staticfromEulerAngles(angles):mat4
Returns a new matrix with the specified euler angles (in radians).
Parameters
| Parameter | Type |
|---|---|
angles | vec3 |
Returns
mat4
fromEulerX()
staticfromEulerX(angle):mat4
Returns a new matrix with x euler angle xAngle (in radians).
Parameters
| Parameter | Type |
|---|---|
angle | number |
Returns
mat4
fromEulerY()
staticfromEulerY(angle):mat4
Returns a new matrix with y euler angle yAngle (in radians).
Parameters
| Parameter | Type |
|---|---|
angle | number |
Returns
mat4
fromEulerZ()
staticfromEulerZ(angle):mat4
Returns a new matrix with z euler angle zAngle (in radians).
Parameters
| Parameter | Type |
|---|---|
angle | number |
Returns
mat4
fromRotation()
staticfromRotation(rotation):mat4
Returns a new matrix with rotation rotation.
Parameters
| Parameter | Type |
|---|---|
rotation | quat |
Returns
mat4
fromRows()
staticfromRows(row0,row1,row2,row3):mat4
Create a 4x4 matrix from four row vectors.
Parameters
Returns
mat4
fromScale()
staticfromScale(scale):mat4
Returns a new matrix with scale scale.
Parameters
| Parameter | Type |
|---|---|
scale | vec3 |
Returns
mat4
fromTranslation()
staticfromTranslation(translation):mat4
Returns a new matrix with the translation translation.
Parameters
| Parameter | Type |
|---|---|
translation | vec3 |
Returns
mat4
identity()
staticidentity():mat4
Returns the identity matrix.
Returns
mat4
inverse()
inverse():
mat4
Returns the inverse of the matrix.
Returns
mat4
lookAt()
staticlookAt(eye,center,up):mat4
Returns a new matrix generated using the provided arguments.
Parameters
Returns
mat4
makeBasis()
staticmakeBasis(x,y,z):mat4
Returns a new matrix using the provided vectors.
Parameters
Returns
mat4
mult()
mult(
mat):mat4
Returns the result of multiplying the two matrices.
Parameters
| Parameter | Type |
|---|---|
mat | mat4 |
Returns
mat4
multiplyDirection()
multiplyDirection(
direction):vec3
Returns the direction vector multiplied by this matrix.
Parameters
| Parameter | Type |
|---|---|
direction | vec3 |
Returns
multiplyPoint()
multiplyPoint(
point):vec3
Returns the point point multiplied by this matrix.
Parameters
| Parameter | Type |
|---|---|
point | vec3 |
Returns
multiplyScalar()
multiplyScalar(
scalar):mat4
Returns the result of scalar multiplying the matrix.
Parameters
| Parameter | Type |
|---|---|
scalar | number |
Returns
mat4
multiplyVector()
multiplyVector(
vector):vec4
Returns the vector multiplied by this matrix.
Parameters
| Parameter | Type |
|---|---|
vector | vec4 |
Returns
orthographic()
staticorthographic(left,right,bottom,top,near,far):mat4
Returns a new matrix generated using the provided arguments.
Parameters
| Parameter | Type |
|---|---|
left | number |
right | number |
bottom | number |
top | number |
near | number |
far | number |
Returns
mat4
outerProduct()
staticouterProduct(a,b):mat4
Returns the outer product of the two matrices.
Parameters
Returns
mat4
perspective()
staticperspective(fov,aspect,near,far):mat4
Returns a new matrix generated using the provided arguments.
Parameters
| Parameter | Type |
|---|---|
fov | number |
aspect | number |
near | number |
far | number |
Returns
mat4
sub()
sub(
mat):mat4
Returns the result of subtracting the two matrices.
Parameters
| Parameter | Type |
|---|---|
mat | mat4 |
Returns
mat4
toString()
toString():
string
Returns a string representation of the matrix.
Returns
string
transpose()
transpose():
mat4
Returns the transpose of this matrix.
Returns
mat4
zero()
staticzero():mat4
Returns a matrix with all zero values.
Returns
mat4