class Leap.Matrix
The Matrix object represents a transformation matrix.
To use this object to transform a Vector, construct a matrix containing the desired transformation and then use the Matrix.transformPoint() or Matrix.transformDirection() functions to apply the transform.
Transforms can be combined by multiplying two or more transform matrices using the times function.
Constructor Top
Matrix () |
Static Properties & Enumerations Top
Leap.Matrix | identity |
Properties Top
Leap.Vector | [0] | ||
Leap.Vector | [1] | ||
Leap.Vector | [2] | ||
Leap.Vector | [3] | ||
Leap.Vector | origin | ||
Leap.Vector | xBasis | ||
Leap.Vector | yBasis | ||
Leap.Vector | zBasis |
Methods Top
Boolean | compare () | |
Leap.Matrix | rigidInverse () | |
void | setRotation (Leap.Vector _axis, float angleRadians) | |
Leap.Matrix | times (Matrix other) | |
Array | toArray3x3 () | |
Array | toArray4x4 () | |
String | toString () | |
Leap.Vector | transformDirection (Leap.Vector in) | |
Leap.Vector | transformPoint (Leap.Vector in) |
Constructor details
Top
matrix.js at line 4
Matrix
()
Constructs a Matrix object.
Creates a new Matrix from the specified Array of Vectors or Matrix.
The default constructor creates an identity matrix.
Constructs a Matrix object.
Creates a new Matrix from the specified Array of Vectors or Matrix. The default constructor creates an identity matrix.
Static Properties & Enumerations Detail Top
matrix.js at line 293
Returns the identity matrix specifying no translation, rotation, and scale.
Properties Detail Top
matrix.js at line 54
The rotation and scale factors for the x-axis.
matrix.js at line 68
The rotation and scale factors for the y-axis.
matrix.js at line 82
The rotation and scale factors for the z-axis.
matrix.js at line 96
The translation factors for all three axes.
matrix.js at line 95
The translation factors for all three axes.
matrix.js at line 53
The rotation and scale factors for the x-axis.
matrix.js at line 67
The rotation and scale factors for the y-axis.
matrix.js at line 81
The rotation and scale factors for the z-axis.
Methods Detail Top
matrix.js at line 275
public
Boolean
compare
()
Compare Matrix equality component-wise.
matrix.js at line 185
Performs a matrix inverse if the matrix consists entirely of rigid transformations (translations and rotations).
If the matrix is not rigid, this operation will not represent an inverse.
Note that all matricies that are directly returned by the API are rigid.
matrix.js at line 112
Sets this transformation matrix to represent a rotation around the specified vector.
This function erases any previous rotation and scale transforms applied to this matrix, but does not affect translation.
matrix.js at line 166
Multiply transform matrices.
Combines two transformations into a single equivalent transformation.
matrix.js at line 206
public
Array
toArray3x3
()
Writes the 3x3 Matrix object to a 9 element row-major float array.
Translation factors are discarded.
matrix.js at line 230
public
Array
toArray4x4
()
Convert a 4x4 Matrix object to a 16 element row-major float array.
Translation factors are discarded.
matrix.js at line 261
public
String
toString
()
Write the matrix to a string in a human readable format.
matrix.js at line 150
Transforms a vector with this matrix by transforming its rotation and scale only.
matrix.js at line 135
Transforms a vector with this matrix by transforming its rotation, scale, and translation.
Translation is applied after rotation and scale.