# new Matrix4()
- Source:
Members
# _dirty :boolean
- Source:
Type:
- boolean
# array :Float32Array
- Source:
Storage of Matrix4
Type:
- Float32Array
# decomposeMatrix
- Source:
- See:
Decompose a matrix to SRT
# x :clay.Vector3
- Source:
X Axis of local transform
Type:
# y :clay.Vector3
- Source:
Y Axis of local transform
Type:
# z :clay.Vector3
- Source:
Z Axis of local transform
Type:
Methods
# adjoint() → {clay.Matrix4}
- Source:
Calculate the adjugate of self, in-place
Returns:
- Type
- clay.Matrix4
# clone() → {clay.Matrix4}
- Source:
Clone a new Matrix4
Returns:
- Type
- clay.Matrix4
# copy(b) → {clay.Matrix4}
- Source:
Copy from b
Parameters:
Name | Type | Description |
---|---|---|
b |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# determinant() → {number}
- Source:
Calculate matrix determinant
Returns:
- Type
- number
# fromMat2d(m2d) → {clay.Matrix4}
- Source:
Set from Matrix2d, it is used when converting a 2d shape to 3d space. In 3d space it is equivalent to ranslate on xy plane and rotate about z axis
Parameters:
Name | Type | Description |
---|---|---|
m2d |
clay.Matrix2d |
Returns:
- Type
- clay.Matrix4
# fromQuat(q) → {clay.Matrix4}
- Source:
Set upper 3x3 part from quaternion
Parameters:
Name | Type | Description |
---|---|---|
q |
clay.Quaternion |
Returns:
- Type
- clay.Matrix4
# fromRotationTranslation(q, v) → {clay.Matrix4}
- Source:
Set from a quaternion rotation and a vector translation
Parameters:
Name | Type | Description |
---|---|---|
q |
clay.Quaternion | |
v |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# frustum(left, right, bottom, top, near, far) → {clay.Matrix4}
- Source:
Set from frustum bounds
Parameters:
Name | Type | Description |
---|---|---|
left |
number | |
right |
number | |
bottom |
number | |
top |
number | |
near |
number | |
far |
number |
Returns:
- Type
- clay.Matrix4
# identity() → {clay.Matrix4}
- Source:
Set to a identity matrix
Returns:
- Type
- clay.Matrix4
# invert() → {clay.Matrix4}
- Source:
Invert self
Returns:
- Type
- clay.Matrix4
# lookAt(eye, center, up) → {clay.Matrix4}
- Source:
Set as a matrix with the given eye position, focal point, and up axis
Parameters:
Name | Type | Description |
---|---|---|
eye |
clay.Vector3 | |
center |
clay.Vector3 | |
up |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# mul(b) → {clay.Matrix4}
- Source:
Alias for mutiply
Parameters:
Name | Type | Description |
---|---|---|
b |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# mulLeft(a) → {clay.Matrix4}
- Source:
Alias for multiplyLeft
Parameters:
Name | Type | Description |
---|---|---|
a |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# multiply(b) → {clay.Matrix4}
- Source:
Multiply self and b
Parameters:
Name | Type | Description |
---|---|---|
b |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# multiplyLeft(a) → {clay.Matrix3}
- Source:
Multiply a and self, a is on the left
Parameters:
Name | Type | Description |
---|---|---|
a |
clay.Matrix3 |
Returns:
- Type
- clay.Matrix3
# ortho(left, right, bottom, top, near, far) → {clay.Matrix4}
- Source:
Set as a orthographic projection matrix
Parameters:
Name | Type | Description |
---|---|---|
left |
number | |
right |
number | |
bottom |
number | |
top |
number | |
near |
number | |
far |
number |
Returns:
- Type
- clay.Matrix4
# perspective(fovy, aspect, near, far) → {clay.Matrix4}
- Source:
Set as a perspective projection matrix
Parameters:
Name | Type | Description |
---|---|---|
fovy |
number | |
aspect |
number | |
near |
number | |
far |
number |
Returns:
- Type
- clay.Matrix4
# rotate(rad, axis) → {clay.Matrix4}
- Source:
Rotate self by rad about axis. Equal to right-multiply a rotaion matrix
Parameters:
Name | Type | Description |
---|---|---|
rad |
number | |
axis |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# rotateX(rad) → {clay.Matrix4}
- Source:
Rotate self by a given radian about X axis. Equal to right-multiply a rotaion matrix
Parameters:
Name | Type | Description |
---|---|---|
rad |
number |
Returns:
- Type
- clay.Matrix4
# rotateY(rad) → {clay.Matrix4}
- Source:
Rotate self by a given radian about Y axis. Equal to right-multiply a rotaion matrix
Parameters:
Name | Type | Description |
---|---|---|
rad |
number |
Returns:
- Type
- clay.Matrix4
# rotateZ(rad) → {clay.Matrix4}
- Source:
Rotate self by a given radian about Z axis. Equal to right-multiply a rotaion matrix
Parameters:
Name | Type | Description |
---|---|---|
rad |
number |
Returns:
- Type
- clay.Matrix4
# scale(s) → {clay.Matrix4}
- Source:
Scale self by s Equal to right-multiply a scale matrix
Parameters:
Name | Type | Description |
---|---|---|
s |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# setArray(arr)
- Source:
Set components from array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Float32Array | Array.<number> |
# translate(v) → {clay.Matrix4}
- Source:
Translate self by v. Equal to right-multiply a translate matrix
Parameters:
Name | Type | Description |
---|---|---|
v |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# transpose() → {clay.Matrix2}
- Source:
Transpose self, in-place.
Returns:
- Type
- clay.Matrix2
# (static) adjoint(out, a) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# (static) copy(out, a) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# (static) determinant(a) → {number}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
a |
clay.Matrix4 |
Returns:
- Type
- number
# (static) fromMat2d(m4, m2d) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
m4 |
clay.Matrix4 | |
m2d |
clay.Matrix2d |
Returns:
- Type
- clay.Matrix4
# (static) fromQuat(out, q) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
q |
clay.Quaternion |
Returns:
- Type
- clay.Matrix4
# (static) fromRotationTranslation(out, q, v) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
q |
clay.Quaternion | |
v |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# (static) identity(out) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# (static) invert(out, a) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# (static) lookAt(out, eye, center, up) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
eye |
clay.Vector3 | |
center |
clay.Vector3 | |
up |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# (static) mul(out, a, b) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
b |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# (static) multiply(out, a, b) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
b |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4
# (static) ortho(out, left, right, bottom, top, near, far) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
left |
number | |
right |
number | |
bottom |
number | |
top |
number | |
near |
number | |
far |
number |
Returns:
- Type
- clay.Matrix4
# (static) perspective(out, fovy, aspect, near, far) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
fovy |
number | |
aspect |
number | |
near |
number | |
far |
number |
Returns:
- Type
- clay.Matrix4
# (static) rotate(out, a, rad, axis) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
rad |
number | |
axis |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# (static) rotateX(out, a, rad) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
rad |
number |
Returns:
- Type
- clay.Matrix4
# (static) rotateY(out, a, rad) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
rad |
number |
Returns:
- Type
- clay.Matrix4
# (static) rotateZ(out, a, rad) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
rad |
number |
Returns:
- Type
- clay.Matrix4
# (static) scale(out, a, v) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
v |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# (static) translate(out, a, v) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 | |
v |
clay.Vector3 |
Returns:
- Type
- clay.Matrix4
# (static) transpose(out, a) → {clay.Matrix4}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
out |
clay.Matrix4 | |
a |
clay.Matrix4 |
Returns:
- Type
- clay.Matrix4