![]() |
KudanAR - iOS
1.6.0
|
#import <ARMatrix4.h>
Inherits NSObject, and <NSCoding>.
Instance Methods | |
(ARMatrix4 *) | - multiplyByMatrix: |
(ARMatrix4 *) | - localMultiplyByMatrix: |
(ARVector3 *) | - multiplyByVector: |
(ARVector3 *) | - localMultiplyByVector: |
(ARVector4 *) | - multiplyByVector4: |
(ARVector4 *) | - localMultiplyByVector4: |
(ARMatrix4 *) | - transpose |
(ARMatrix4 *) | - localTranspose |
(ARMatrix4 *) | - inverse |
(ARMatrix4 *) | - localInverse |
(float *) | - makeGLMatrix: |
(float *) | - makeGLRotationMatrix: |
(ARVector3 *) | - scale |
(ARVector3 *) | - translation |
(ARQuaternion *) | - orientation |
Class Methods | |
(ARMatrix4 *) | + matrixWithIdentity |
(ARMatrix4 *) | + matrixWithValues: |
(ARMatrix4 *) | + matrixWithTranslation:rotation:scale: |
(ARMatrix4 *) | + frustumWithFOV:aspect:near:far:zoom: |
(ARMatrix4 *) | + frustumWithLeft:right:bottom:top:near:far: |
(ARMatrix4 *) | + orthoWithLeft:right:bottom:top:near:far: |
(ARMatrix4 *) | + matrixWithOML: [implementation] |
Properties | |
OgreMathLib::Matrix4 | matrixOML [implementation] |
An ARMatrix4 is a math class that represents a 4x4 Matrix. The methods in this class both create new transformation matrices using given data and perform matrix calculations.
+ (ARMatrix4 *) frustumWithFOV: | (float) | fov | |
aspect: | (float) | aspect | |
near: | (float) | near | |
far: | (float) | far | |
zoom: | (float) | zoom | |
Creates a new 4x4 perspective matrix with the given field-of-view, aspect ratio, near plane distance, far plane distance and zoom paramaters. This represents a frustum extending out from the centre of the camera view.
Example of use:
fov | The "field of view" of this perspective matrix, representing the vertical angle of the camera through which we are looking at the world. |
aspect | The "aspect ratio" between the width and the height of the rectangular area which will be the target of projection. For example, a 16:9 aspect ratio would be ~1.78. |
near | The "near clipping plane" of this perspective matrix. Objects nearer to the camera than the near plane will not be rendered. |
far | The "far clipping plane" of this perspective matrix. Objects further away from the camera than the far plane will not be rendered. |
zoom | An artificial "zoom" factor separate from the FOV. Useful for creating special effects like a Dolly zoom. |
+ (ARMatrix4 *) frustumWithLeft: | (float) | left | |
right: | (float) | right | |
bottom: | (float) | bottom | |
top: | (float) | top | |
near: | (float) | near | |
far: | (float) | far | |
Creates a new 4x4 perspective matrix with the given plane distances. This represents a frustum extending out from the centre of the camera view.
Example of use:
left | How far the left-hand plane is from the centre of the camera view. Used to calculate the horizontal field of view and the aspect ratio. |
right | How far the right-hand plane is from the centre of the camera view. Used to calculate the horizontal field of view and the aspect ratio. |
bottom | How far the bottom plane is from the centre of the camera view. Used to calculate the vertical field of view and the aspect ratio. |
top | How far the top plane is from the centre of the camera view. Used to calculate the vertical field of view and the aspect ratio. |
near | How far the near plane is from the camera. Used to determine how close to the camera an object can be before it is clipped. |
far | How far the far plane is form the camera. Used to determine how far away from the camera an object can be before it is clipped. |
- (ARMatrix4 *) inverse |
- (ARMatrix4 *) localInverse |
Calculates the inverse of this matrix and assigns the result to this matrix.
Example of use:
Multiplies this matrix by another 4x4 matrix and assigns the result to this matrix.
Example of use:
matrix | The 4x4 matrix to multiply this matrix by. |
Multiplies this matrix by a Vector4 and assigns the result to the passed vector.
Example of use:
vector | The vector (X, Y, Z, W) to multiply this matrix by. |
Multiplies this matrix by a Vector3 and assigns the result to the passed vector.
Example of use:
vector | The vector (X, Y, Z) to multiply this matrix by. |
- (ARMatrix4 *) localTranspose |
Transposes this matrix and assigns the result to this matrix.
Example of use:
- (float *) makeGLMatrix: | (float *) | matrix |
Creates a float array representing a 4x4 transformation matrix for use by OpenGL as a buffer using a given set of floats. This method assigns to the parameter passed to it.
The data expected by OpenGL is different to that of a standard transformation matrix. As such, it must be converted.
Example of use:
matrix | An array of floats to convert to a transformation matrix. |
- (float *) makeGLRotationMatrix: | (float *) | matrix |
Creates a float array representing a 3x3 rotation matrix for use by OpenGL as a buffer using a given set of floats. This method assigns to the paramater passed to it.
Example of use:
matrix | An array of floats to convert to a rotation matrix. |
+ (ARMatrix4 *) matrixWithIdentity |
Creates a new 4x4 identity matrix.
Example of use:
+ (ARMatrix4 *) matrixWithTranslation: | (ARVector3 *) | translation | |
rotation: | (ARQuaternion *) | rotation | |
scale: | (ARVector3 *) | scale | |
Creates a new 4x4 transformation matrix with the given parameters.
Example of use:
translation | The translation to use in the transformation matrix. |
rotation | The rotation to use in the transformation matrix. |
scale | The scale to use in the transformation matrix. |
+ (ARMatrix4 *) matrixWithValues: | (float *) | values |
Creates a new m4x4 matrix with the given array of values. This will be a matrix with the column major order.
Example of use:
values | The array of float values to initialise the matrix with. |
Multiplies this matrix by another 4x4 matrix and returns the result as a new matrix. This matrix will the LHS, the other matrix will be the RHS.
Example of use:
matrix | The 4x4 matrix to multiply this matrix by. |
Multiplies this matrix by a Vector4 and returns the result as a new Vector4.
Example of use:
vector | The vector (X, Y, Z, W) to multiply this matrix by. |
Multiplies this matrix by a Vector3 and returns the result as a new Vector3.
Example of use:
vector | The vector (X, Y, Z) to multiply this matrix by. |
- (ARQuaternion *) orientation |
Returns the rotation component of this transformation matrix.
Example of use:
+ (ARMatrix4 *) orthoWithLeft: | (float) | left | |
right: | (float) | right | |
bottom: | (float) | bottom | |
top: | (float) | top | |
near: | (float) | near | |
far: | (float) | far | |
Creates a new 4x4 orthographic with the given plane distances. This represents a box with the minimum corner at (left, bottom, -near) and the maximum corner at (right, top, -far).
Example of use:
left | How far the left-hand plane is from the centre of the bounding box. |
right | How far the right-hand plane is from the centre of the bounding box. |
bottom | How far the bottom plane is from the centre of the bounding box. |
top | How far the top plane is from the centre of the bounding box. |
near | How far the near plane is from the camera. Used to determine how close to the camera an object can be before it is clipped. |
far | How far the far plane is form the camera. Used to determine how far away from the camera an object can be before it is clipped. |
- (ARVector3 *) scale |
- (ARVector3 *) translation |
Returns the translation component of this transformation matrix.
Example of use:
- (ARMatrix4 *) transpose |