Constructor
new L3D.Matrix3(…arguments)
Creates a new matrix.
new Matrix3() // Creates an identity matrix
new Matrix3(Matrix3) // Creates a clone of the given matrix.
new Matrix3(Array[9]) // Creates a Matrix4 from the given array.
new Matarix3(0) // Creates a zero matrix.
new Matrix3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22) // Create a matrix from individual elements.
arguments* |
* | Variable arguments for constructor overloading. |
Properties
Methods
clone() → Matrix3
Create a copy of this matrix.
determinant() → number
Calculate the determinant of the matrix.
- number
invert() → Matrix3
Invert this matrix.
rotate(angle) → Matrix3
Rotate the matrix by a given angle
angle |
number |
scale(v) → Matrix3
Scale the matrix by the given vector.
v |
Vector2 |
setFrom()
setFrom(m00, m01, m02, m10, m11, m12, m20, m21, m22)
setFrom([m00, m01, m02, m10, m11, m12, m20, m21, m22])
setFrom(Matrix3)
setIdentity() → Matrix3
Set the matrix as an identity matrix.
setQuaternion(q) → Matrix3
Set the matrix as a rotation matrix.
q |
Quaternion |
setRotate(angle) → Matrix3
Set the matrix as a rotation matrix.
angle |
number |
setScale(v) → Matrix3
Set the matrix as a scale matrix.
v |
Vector2 |
setTranslate(v) → Matrix3
Set the matrix as a translation matrix.
v |
Vector2 |
toArray() → Array.<number>
Convert the matrix to an Array.
- Array.<number>
transformVector2(v, z, out) → Vector2
Transform a Vector2 by this matrix.
v |
Vector2 | ||
z |
number |
1
|
|
out |
Vector2 |
transformVector3(v, out) → Vector3
Transofrm a Vector3 by this matrix.
v |
Vector3 | |
out |
Vector3 |
translate(v) → Matrix3
Translate the matrix by the given vector.
v |
Vector2 |
transpose() → Matrix3
Transpose this matrix.
static invert(m, out) → Matrix3
Invert a matrix.
m |
Matrix3 | |
out |
Matrix3 |
static multiply(a, b, out)
Multiply two matrices together.
a |
Matrix3 | |
b |
Matrix3 | |
out |
Matrix3 |
static rotate(m, angle, out)
Rotate a matrix by the given angle.
m |
Matrix3 | |
angle |
number | |
out |
Matrix3 |
static scale(m, v, out)
Scale a matrix.
m |
Matrix3 | |
v |
Vector2 | |
out |
Matrix3 |
static translate(m, v, out) → Matrix3
Translate the matrix by the given vector. Returns a new matrix.
m |
Matrix3 | |
v |
Vector2 | |
out |
Matrix3 |
static transpose(m, out) → Matrix3
Transpose a matrix
m |
Matrix3 | |
out |
Matrix3 |