class Mat4
package iron.math
Static methods
staticinlinefromFloat32Array(a:Float32Array, offset:Int = 0):Mat4
Set all components of this matrix from an array.
Parameters:
a | The 16-component array to use. Components should be in the
same order as for |
---|---|
offset | An offset index to the start of the data in the array. Defaults to 0. |
Returns:
A new matrix.
staticinlineidentity():Mat4
Create a matrix that represents no transform - located at the origin, zero rotation, and a uniform scale of 1.
Returns:
A new matrix.
staticinlineortho(left:FastFloat, right:FastFloat, bottom:FastFloat, top:FastFloat, near:FastFloat, far:FastFloat):Mat4
Create a new orthographic projection matrix.
Parameters:
left | The left of the box. |
---|---|
right | The right of the box. |
bottom | The bottom of the box. |
top | The top of the box. |
near | The depth of the near floor of the box. |
far | The depth of the far floor of the box. |
Returns:
A new matrix.
staticinlinepersp(fovY:FastFloat, aspect:FastFloat, zn:FastFloat, zf:FastFloat):Mat4
Create a new perspective projection matrix.
Parameters:
fovY | The vertical field of view. |
---|---|
aspect | The aspect ratio. |
zn | The depth of the near floor of the frustum. |
zf | The depth of the far floor of the frustum. |
Returns:
A new matrix.
Constructor
Variables
Methods
inlineapplyQuat(q:Quat):Void
Apply an additional rotation to this matrix.
Parameters:
q | The quaternion to rotate by. |
---|
inlinecompose(loc:Vec4, quat:Quat, sc:Vec4):Mat4
Set the transform from a location, rotation and scale.
Parameters:
loc | The location to use. |
---|---|
quat | The rotation to use. |
sc | The scale to use. |
Returns:
This matrix.
inlinedecompose(loc:Vec4, quat:Quat, scale:Vec4):Mat4
Decompose this matrix into its location, rotation and scale components. Additional transforms (skew, projection) will be ignored.
Parameters:
loc | A vector to write the location to. |
---|---|
quat | A quaternion to write the rotation to. |
scale | A vector to write the scale to. |
Returns:
This matrix.
inlinefromQuat(q:Quat):Mat4
Set the transform to a rotation from a quaternion. Other existing transforms will be removed.
Parameters:
q | The rotation to use. |
---|
Returns:
This matrix.
inlinegetInverse(m:Mat4):Mat4
Invert a matrix and store the result in this one.
Parameters:
m | The matrix to invert. |
---|
Returns:
This matrix.
inlineinitTranslate(x:FastFloat = 0.0, y:FastFloat = 0.0, z:FastFloat = 0.0):Mat4
Reset this matrix to the identity and set its location.
Parameters:
x | The x location. |
---|---|
y | The y location. |
z | The z location. |
Returns:
This matrix.
inlinemult(s:FastFloat):Mat4
Multiply this vector by a scalar.
Parameters:
s | The value to multiply by. |
---|
Returns:
This matrix.
inlineright():Vec4
Returns:
The right vector; the positive x axis of the space defined by this matrix.
inlinescale(v:Vec4):Mat4
Apply an additional scale to this matrix.
Parameters:
v | The vector to scale by. |
---|
Returns:
This matrix.
inlinesetLoc(v:Vec4):Mat4
Set the location component of this matrix.
Parameters:
v | The location to use. |
---|
Returns:
This matrix.
inlinetoRotation():Mat4
Convert this matrix to a rotation matrix, and discard location and scale information.
Returns:
This matrix.