kick.math.Mat2d Class
Mat2 - 2x3 Matrix A mat2d contains six elements defined as:
[a, b, c, d, tx,ty]This is a short form for the 3x3 matrix:
[a, b, 0 c, d, 0 tx,ty,1]The last column is ignored so the array is shorter and operations are faster.
Item Index
Methods
clone
-
a
Creates a new mat2d initialized with values from an existing matrix
Parameters:
-
a
kick.math.Mat2dmatrix to clone
Returns:
a new 2x3 matrix
copy
-
out
-
a
Copy the values from one mat2d to another
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
-
a
kick.math.Mat2dthe source matrix
Returns:
out
determinant
-
a
Calculates the determinant of a Mat2d
Parameters:
-
a
kick.math.Mat2dthe source matrix
Returns:
determinant of a
identity
-
out
Sets a Mat2d to the identity matrix
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
Returns:
out
invert
-
out
-
a
Inverts a Mat2d
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
-
a
kick.math.Mat2dthe source matrix
Returns:
out
multiply
-
out
-
a
-
b
Multiplies two Mat2d's
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
-
a
kick.math.Mat2dthe first operand
-
b
kick.math.Mat2dthe second operand
Returns:
out
rotate
-
out
-
a
-
rad
Rotates a mat2d by the given angle
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
-
a
kick.math.Mat2dthe matrix to rotate
-
rad
Numberthe angle to rotate the matrix by
Returns:
out
scale
-
out
-
a
-
v
Scales the mat2d by the dimensions in the given vec2
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
-
a
kick.math.Mat2dthe matrix to rotate
-
v
kick.math.Vec2the vec2 to scale the matrix by
Returns:
out
str
-
a
Returns a string representation of a Mat2d
Parameters:
-
a
kick.math.Mat2dmatrix to represent as a string
Returns:
string representation of the matrix
strPretty
-
mat
Returns a string representation of a Mat2d printed as a 3x3 matrix (on 3 lines)
Parameters:
-
mat
kick.math.Mat2dmat2d to represent as a string
Returns:
string representation of mat
translate
-
out
-
a
-
v
Translates the mat2d by the dimensions in the given vec2
Parameters:
-
out
kick.math.Mat2dthe receiving matrix
-
a
kick.math.Mat2dthe matrix to translate
-
v
kick.math.Vec2the vec2 to translate the matrix by
Returns:
out