Struct mat4
float matrix 4 x 4
struct mat4;
Constructors
| Name | Description |
|---|---|
this
(v)
|
|
this
(v)
|
Fields
| Name | Type | Description |
|---|---|---|
IDENTITY
|
const(mat4) | |
m
|
float[16] |
Properties
| Name | Type | Description |
|---|---|---|
backVector[get]
|
vec3 | |
determinant[get]
|
float | |
dump[get]
|
string | |
forwardVector[get]
|
vec3 |
Methods
| Name | Description |
|---|---|
decompose
(scale, rotation, translation)
|
Decomposes the scale, rotation and translation components of this matrix. |
fill
(v)
|
fill all items of matrix with specified value |
getTranslation
(translation)
|
Gets the translational component of this matrix in the specified vector. |
identity
()
|
creates identity matrix |
invert
()
|
|
lookAt
(eye, center, up)
|
|
mul
(m1, m2)
|
multiply two matrices |
opAssign
(v)
|
|
opAssign
(v)
|
|
opAssign
(v)
|
|
opBinary
(v)
|
add scalar to all items of matrix |
opBinary
(v)
|
multiply this matrix by scalar |
opBinary
(m2)
|
multiply this matrix by another matrix |
opBinary
(vector)
|
multiply matrix by vec3 |
opBinary
(vector)
|
multiply matrix by vec4 |
opIndex
(y, x)
|
2d index by row, col |
opIndex
(index)
|
scalar index by rows then (y*4 + x) |
opOpAssign
(m2)
|
multiply this matrix by another matrix |
opOpAssign
(v)
|
add value to all components of matrix |
opOpAssign
(v)
|
multiply all components of matrix by value |
opOpAssign
(v)
|
subtract value from all components of matrix |
opOpAssign
(v)
|
divide all components of vector by matrix |
rotate
(angle, axis)
|
|
rotate
(angle, x, y, z)
|
|
rotatex
(angle)
|
inplace rotate around X axis |
rotateX
(angle)
|
|
rotatey
(angle)
|
inplace rotate around Y axis |
rotateY
(angle)
|
|
rotatez
(angle)
|
inplace rotate around Z axis |
rotateZ
(angle)
|
|
scale
(x, y, z)
|
|
scale
(v)
|
|
scale
(v)
|
|
setDiagonal
(v)
|
set to diagonal: fill all items of matrix with zero except main diagonal items which will be assigned to v |
setIdentity
()
|
set to identity: fill all items of matrix with zero except main diagonal items which will be assigned to 1.0f |
setLookAt
(eye, center, up)
|
|
setOrtho
(left, right, bottom, top, nearPlane, farPlane)
|
|
setPerspective
(angle, aspect, nearPlane, farPlane)
|
|
setZero
()
|
fill all items of matrix with zero |
transformPoint
(v)
|
|
transformVector
(v)
|
|
transformVector
(x, y, z, w, dst)
|
|
translate
(v)
|
|
translate
(x, y, z)
|
|
translation
(x, y, z)
|
|
transpose
()
|
transpose matrix |
zero
()
|
creates zero matrix |