Inherits ScriptObject.
Public Attributes | |
Number | n1 |
The 1-norm. | |
Number | n2 |
The 2-norm. | |
Matrix | negated |
The negated matrix. | |
Matrix | transposed |
The transposed matrix (equal to the inverse for rotations). | |
Vector | up |
The up vector. | |
Vector | right |
The right vector. | |
Vector | forward |
The forward vector. | |
Vector | eulerXZX |
Euler angles in radians for XZX static/world convention. | |
Vector | eulerYXY |
Euler angles in radians for YXY static/world convention. | |
Vector | eulerZYZ |
Euler angles in radians for ZYZ static/world convention. | |
Vector | eulerXZX_R |
Euler angles in radians for XZX body convention. | |
Vector | eulerYXY_R |
Euler angles in radians for YXY body convention. | |
Vector | eulerZYZ_R |
Euler angles in radians for ZYZ body convention. | |
Vector | eulerXZY |
Euler angles in radians for XZY static/world convention. | |
Vector | eulerYXZ |
Euler angles in radians for YXZ static/world convention. | |
Vector | eulerZYX |
Euler angles in radians for ZYX static/world convention. | |
Vector | eulerYZX_R |
Euler angles in radians for YZX body convention. | |
Vector | eulerZXY_R |
Euler angles in radians for ZXY body convention. | |
Vector | eulerXYZ_R |
Euler angles in radians for XYZ body convention. | |
Vector | eulerXYX |
Euler angles in radians for XYX static/world convention. | |
Vector | eulerYZY |
Euler angles in radians for YZY static/world convention. | |
Vector | eulerZXZ |
Euler angles in radians for ZXZ static/world convention. | |
Vector | eulerXYX_R |
Euler angles in radians for XYX body convention. | |
Vector | eulerYZY_R |
Euler angles in radians for YZY body convention. | |
Vector | eulerZXZ_R |
Euler angles in radians for ZXZ body convention. | |
Vector | eulerXYZ |
Euler angles in radians for XYZ static/world convention. | |
Vector | eulerYZX |
Euler angles in radians for YZX static/world convention. | |
Vector | eulerZXY |
Euler angles in radians for ZXY static/world convention. | |
Vector | eulerZYX_R |
Euler angles in radians for ZYX body convention. | |
Vector | eulerXZY_R |
Euler angles in radians for XZY body convention. | |
Vector | eulerYXZ_R |
Euler angles in radians for YXZ body convention. | |
A 3 by 3 matrix.
enum EulerConvention |
Euler conventions.
Matrix | ( | ) |
Construct a matrix as the identity matrix.
Constructs the matrix with the specified right, up, and forward directions.
Constructs the matrix as the specified axis rotation.
axis | The axis of rotation. |
angle | The angle of rotation (radians). |
add | ( | Matrix | right | ) |
Adds the specified matrix to this matrix.
clamp | ( | Number | epsilon | ) |
Clamps the matrix elements to -1, 0, and -1 with the specified epsilon value.
Returns the difference between the specified matrices.
Returns the rotation matrix for the specified axis rotation.
axis | The axis of rotation. |
angle | The angle (in radians). |
Returns the specified column.
column | The column [0; 2]. |
Returns the value of the specified element.
row | The row [0; 2]. |
column | The column [0; 2]. |
Returns the Euler angle for the specified convention in radians. Use getEuler2() instead to get the standard Euler conventions.
Returns the Euler angle for the specified convention in radians.
Returns the rotation for the specified Euler angles and convention.
Returns the rotation matrix for the specified Euler rotation (XYX static convention). Angles are in radians.
Vector getEulerXYZ | ( | ) |
Returns the Euler angles (XYZ convention) in radians. Use Matrix.getEuler2() instead.
Returns the rotation matrix for the specified Euler rotation (XYZ static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (XZX static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (XZY static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (YXY static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (YXZ static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (YZX static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (YZY static convention). Angles are in radians.
Returns the rotation matrix for the specified Euler rotation (ZXY static convention). Angles are in radians.
Vector getEulerZXZ | ( | ) |
Returns the Euler angles (ZXZ convention) in radians. Use Matrix.getEuler2() instead.
Returns the rotation matrix for the specified Euler rotation (ZXZ static convention). Angles are in radians.
Vector getEulerZYX | ( | ) |
Returns the Euler angles (ZYX convention) in radians. Use Matrix.getEuler2() instead.
Returns the rotation matrix for the specified Euler rotation (ZYX static convention). Angles are in radians.
Vector getEulerZYZ | ( | ) |
Returns the Euler angles (ZYZ convention) in radians. Use Matrix.getEuler2() instead.
Returns the rotation matrix for the specified Euler rotation (ZYZ static convention). Angles are in radians.
Vector getForward | ( | ) |
Returns the forward vector.
Number getN1 | ( | ) |
Return N1 of this matrix.
Number getN2 | ( | ) |
Return N2 of this matrix.
Matrix getNegated | ( | ) |
Returns the negated matrix.
Returns a matrix that satisfies the supplied forward vector. Since only a single vector is supplied the resultant matrix can be rotated at any angle around the forward vector.
Vector getRight | ( | ) |
Returns the right vector.
Returns the X and Y rotations around the fixed frame to match the forward direction. Primary and secondary specifies the preferred rotations and must be different.
primary | The primary coordinate (0, or 1). |
secondary | The secondary coordinate (0 or 1). |
Matrix getTransposed | ( | ) |
Returns the transposed matrix.
Returns the X, Y, Z rotations around the fixed frame to match the forward direction. Primary and secondary specifies the preferred rotations and must be different.
primary | The primary coordinate (0, 1, or 2). |
secondary | The secondary coordinate (0, 1, or 2). |
Vector getUp | ( | ) |
Returns the up vector.
Returns the matrix for the specified X-axis rotation. The matrix will rotate the vector and not the frame.
angle | The rotation angle in radians. |
Returns the matrix for the specified X, Y, and Z rotations. The matrix will rotate the vector and not the frame. The order of the rotations are X, Y, and then Z.
abc | The rotation XYZ angles in radians. |
Returns the matrix for the specified Y-axis rotation. The matrix will rotate the vector and not the frame.
angle | The rotation angle in radians. |
Returns the matrix for the specified Z-axis rotation. The matrix will rotate the vector and not the frame.
angle | The rotation angle in radians. |
Boolean isIdentity | ( | ) |
Returns true if the matrix is the identity matrix.
Boolean isZero | ( | ) |
Returns true if the matrix is the zero matrix (i.e. all elements are set to 0).
Returns the multiple of this matrix (left) and the specified value (right).
Returns the multiple of this matrix (left) and the specified matrix (right).
Returns the multiple of this matrix (left) and the specified vector (right).
negate | ( | ) |
Negates this matrix.
normalize | ( | ) |
Normalizes the orientation.
rotateX | ( | Number | angle | ) |
Rotates this matrix around the X-axis by the specified angle.
angle | The rotation angle in radians. |
rotateY | ( | Number | angle | ) |
Rotates this matrix around the Y-axis by the specified angle.
angle | The rotation angle in radians. |
rotateZ | ( | Number | angle | ) |
Rotates this matrix around the Z-axis by the specified angle.
angle | The rotation angle in radians. |
Sets the specified column.
column | The column [0; 2]. |
value | The desired column vector. |
Sets the value of the specified element.
row | The row [0; 2]. |
column | The column [0; 2]. |
value | The desired value of the element. |
setForward | ( | Vector | value | ) |
Sets the forward vector.
value | The forward vector. |
setRight | ( | Vector | value | ) |
Sets the right vector.
value | The right vector. |
Sets the specified row.
row | The row [0; 2]. |
value | The desired row vector. |
setUp | ( | Vector | value | ) |
Sets the up vector.
value | The up vector. |
subtract | ( | Matrix | right | ) |
Subtracts the specified matrix from this matrix.
Returns the difference between the specified matrices.
String toString | ( | ) |
Converts the matrix to a string (e.g. [[1, 2, 3], [4, 5, 6], [7, 8, 9]]).
transpose | ( | ) |
Transposed this matrix.