![]() |
Leap Motion C# API Reference
0.8.0
|
The Matrix struct represents a transformation matrix. More...
Inherits IDisposable.
Public Member Functions | |
bool | Equals (Matrix other) |
Compare Matrix equality component-wise. | |
Matrix () | |
Constructs an identity transformation matrix. | |
Matrix (Matrix other) | |
Constructs a copy of the specified Matrix object. | |
Matrix (Vector _xBasis, Vector _yBasis, Vector _zBasis) | |
Constructs a transformation matrix from the specified basis vectors. | |
Matrix (Vector _xBasis, Vector _yBasis, Vector _zBasis, Vector _origin) | |
Constructs a transformation matrix from the specified basis and translation vectors. | |
Matrix (Vector axis, float angleRadians) | |
Constructs a transformation matrix specifying a rotation around the specified vector. | |
Matrix (Vector axis, float angleRadians, Vector translation) | |
Constructs a transformation matrix specifying a rotation around the specified vector and a translation by the specified vector. | |
Matrix | RigidInverse () |
Performs a matrix inverse if the matrix consists entirely of rigid transformations (translations and rotations). | |
void | SetRotation (Vector axis, float angleRadians) |
Sets this transformation matrix to represent a rotation around the specified vector. | |
float[] | ToArray3x3 (float[] output) |
Copy this matrix to the specified array of 9 float values in row-major order. | |
double[] | ToArray3x3 (double[] output) |
Copy this matrix to the specified array containing 9 double values in row-major order. | |
float[] | ToArray3x3 () |
Convert this matrix to an array containing 9 float values in row-major order. | |
float[] | ToArray4x4 (float[] output) |
Copy this matrix to the specified array of 16 float values in row-major order. | |
double[] | ToArray4x4 (double[] output) |
Copy this matrix to the specified array of 16 double values in row-major order. | |
float[] | ToArray4x4 () |
Convert this matrix to an array containing 16 float values in row-major order. | |
override string | ToString () |
Write the matrix to a string in a human readable format. | |
Vector | TransformDirection (Vector arg0) |
Transforms a vector with this matrix by transforming its rotation and scale only. | |
Vector | TransformPoint (Vector arg0) |
Transforms a vector with this matrix by transforming its rotation, scale, and translation. | |
Static Public Member Functions | |
static Matrix | operator* (Matrix m1, Matrix m2) |
Multiply two matrices. | |
Properties | |
static Matrix | Identity [get] |
Returns the identity matrix specifying no translation, rotation, and scale. | |
Vector | origin [get, set] |
The translation factors for all three axes. | |
Vector | xBasis [get, set] |
The rotation and scale factors for the x-axis. | |
Vector | yBasis [get, set] |
The rotation and scale factors for the y-axis. | |
Vector | zBasis [get, set] |
The rotation and scale factors for the z-axis. | |
The Matrix struct represents a transformation matrix.
To use this struct 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 * operator.
|
inline |
Constructs an identity transformation matrix.
Constructs a transformation matrix from the specified basis and translation vectors.
|
inline |
Constructs a transformation matrix specifying a rotation around the specified vector.
axis | A Vector specifying the axis of rotation. |
angleRadians | The amount of rotation in radians. |
Constructs a transformation matrix specifying a rotation around the specified vector and a translation by the specified vector.
|
inline |
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.
|
inline |
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.
axis | A Vector specifying the axis of rotation. |
angleRadians | The amount of rotation in radians. |
|
inline |
Copy this matrix to the specified array of 9 float values in row-major order.
|
inline |
Copy this matrix to the specified array containing 9 double values in row-major order.
|
inline |
Convert this matrix to an array containing 9 float values in row-major order.
|
inline |
Copy this matrix to the specified array of 16 float values in row-major order.
|
inline |
Copy this matrix to the specified array of 16 double values in row-major order.
|
inline |
Convert this matrix to an array containing 16 float values in row-major order.
|
inline |
Write the matrix to a string in a human readable format.
|
staticget |
Returns the identity matrix specifying no translation, rotation, and scale.
|
getset |
The translation factors for all three axes.
|
getset |
The rotation and scale factors for the x-axis.
|
getset |
The rotation and scale factors for the y-axis.
|
getset |
The rotation and scale factors for the z-axis.