The LeapMatrix class represents a transformation matrix. More...
Inherits NSObject.
Instance Methods | |
(BOOL) | - equals: |
Compare LeapMatrix equality component-wise. More... | |
(id) | - initWithAxis:angleRadians: |
Constructs a transformation matrix specifying a rotation around the specified vector. More... | |
(id) | - initWithAxis:angleRadians:translation: |
Constructs a transformation matrix specifying a rotation around the specified vector and a translation by the specified vector. More... | |
(id) | - initWithMatrix: |
Constructs a copy of the specified Matrix object. More... | |
(id) | - initWithXBasis:yBasis:zBasis:origin: |
Constructs a transformation matrix from the specified basis and translation vectors. More... | |
(LeapMatrix *) | - times: |
Multiply transform matrices. More... | |
(LeapVector *) | - transformDirection: |
Transforms a vector with this matrix by transforming its rotation and scale only. More... | |
(LeapVector *) | - transformPoint: |
Transforms a vector with this matrix by transforming its rotation, scale, and translation. More... | |
Class Methods | |
(LeapMatrix *) | + identity |
Returns the identity matrix specifying no translation, rotation, and scale. More... | |
Properties | |
LeapVector * | origin |
The translation factors for all three axes. More... | |
LeapMatrix * | rigidInverse |
Performs a matrix inverse if the matrix consists entirely of rigid transformations (translations and rotations). More... | |
NSMutableArray * | toNSArray3x3 |
Converts a LeapMatrix object to a 9-element NSArray object. More... | |
NSMutableArray * | toNSArray4x4 |
Converts a LeapMatrix object to a 16-element NSArray object. More... | |
LeapVector * | xBasis |
The rotation and scale factors for the x-axis. More... | |
LeapVector * | yBasis |
The rotation and scale factors for the y-axis. More... | |
LeapVector * | zBasis |
The rotation and scale factors for the z-axis. More... | |
The LeapMatrix class represents a transformation matrix.
To use this class to transform a LeapVector, construct a matrix containing the desired transformation and then use the [LeapMatrix transformPoint:] or [LeapMatrix transformDirection:] functions to apply the transform.
Transforms can be combined by multiplying two or more transform matrices using the [LeapMatrix times:] function.
- (BOOL) equals: | (const LeapMatrix *) | other |
Compare LeapMatrix equality component-wise.
other | The LeapMatrix object to compare. |
+ (LeapMatrix *) identity |
Returns the identity matrix specifying no translation, rotation, and scale.
- (id) initWithAxis: | (const LeapVector *) | axis | |
angleRadians: | (float) | angleRadians | |
Constructs a transformation matrix specifying a rotation around the specified vector.
axis | A LeapVector specifying the axis of rotation. |
angleRadians | The amount of rotation in radians. |
- (id) initWithAxis: | (const LeapVector *) | axis | |
angleRadians: | (float) | angleRadians | |
translation: | (const LeapVector *) | translation | |
Constructs a transformation matrix specifying a rotation around the specified vector and a translation by the specified vector.
axis | A LeapVector specifying the axis of rotation. |
angleRadians | The angle of rotation in radians. |
translation | A LeapVector representing the translation part of the transform. |
- (id) initWithMatrix: | (LeapMatrix *) | matrix |
Constructs a copy of the specified Matrix object.
matrix | the LeapMatrix to copy. |
- (id) initWithXBasis: | (const LeapVector *) | xBasis | |
yBasis: | (const LeapVector *) | yBasis | |
zBasis: | (const LeapVector *) | zBasis | |
origin: | (const LeapVector *) | origin | |
Constructs a transformation matrix from the specified basis and translation vectors.
xBasis | A LeapVector specifying rotation and scale factors for the x-axis. |
yBasis | A LeapVector specifying rotation and scale factors for the y-axis. |
zBasis | A LeapVector specifying rotation and scale factors for the z-axis. |
origin | A LeapVector specifying translation factors on all three axes. |
- (LeapMatrix *) times: | (const LeapMatrix *) | other |
Multiply transform matrices.
Combines two transformations into a single equivalent transformation.
other | A LeapMatrix to multiply on the right hand side. |
- (LeapVector *) transformDirection: | (const LeapVector *) | direction |
Transforms a vector with this matrix by transforming its rotation and scale only.
direction | The LeapVector to transform. |
- (LeapVector *) transformPoint: | (const LeapVector *) | point |
Transforms a vector with this matrix by transforming its rotation, scale, and translation.
Translation is applied after rotation and scale.
point | A LeapVector representing the 3D position to transform. |
|
readwritenonatomicstrong |
|
readnonatomicassign |
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.
|
readnonatomicassign |
Converts a LeapMatrix object to a 9-element NSArray object.
The elements of the matrix are inserted into the array in row-major order.
Translation factors are discarded.
|
readnonatomicassign |
Converts a LeapMatrix object to a 16-element NSArray object.
The elements of the matrix are inserted into the array in row-major order.
|
readwritenonatomicstrong |
|
readwritenonatomicstrong |
|
readwritenonatomicstrong |