#import <CC3AffineMatrix.h>
Additional Inherited Members | |
Class Methods inherited from CC3Matrix | |
(id) | + matrix |
(id) | + matrixByMultiplying:by: |
Properties inherited from CC3Matrix | |
BOOL | isDirty |
BOOL | isIdentity |
BOOL | isRigid |
CC3AffineMatrix is a 4x3 matrix that can represent affine transforms such as rotation, scaling, reflection, shearing, and translation.
Affine matrices differ from linear matrices in that affine matrices can perform translation transformations.
Internally, the dimensions of this matrix are four columns by three rows. Data is held in a CC3Matrix4x3 structure of 12 GLfloat elements in column-major order. For situations requiring only 3D affine transformations, this offers a storage savings over using a full 4x4 matrix.
Although this matrix has only three rows, it behaves like a square matrix with four columns and four rows, with the missing row always taken to contain (0, 0, 0, 1). Since all affine transforms never change this last row, the requirement to store this last row is dropped in order to reduce memory and calculation overhead. Where operations require this last row to be present, it is temporarily generated automatically.
- (void) populateFromFrustumLeft: | (GLfloat) | left | |
andRight: | (GLfloat) | right | |
andTop: | (GLfloat) | top | |
andBottom: | (GLfloat) | bottom | |
andNear: | (GLfloat) | near | |
Populates this matrix as an infinite-depth perspective projection matrix with the specified frustum dimensions, where the far clipping plane is set at an infinite distance.
Affine matrices cannot support perspective projection. This method throws an assertion exception.
Implements CC3Matrix.
- (void) populateFromFrustumLeft: | (GLfloat) | left | |
andRight: | (GLfloat) | right | |
andTop: | (GLfloat) | top | |
andBottom: | (GLfloat) | bottom | |
andNear: | (GLfloat) | near | |
andFar: | (GLfloat) | far | |
Populates this matrix as a perspective projection matrix with the specified frustum dimensions.
Affine matrices cannot support perspective projection. This method throws an assertion exception.
Implements CC3Matrix.
- (void) transpose |
Transposes this matrix.
The contents of this matrix are changed.
Since the affine matrix does not store the fourth row, transposing an affine matrix will result in the contents of the fourth column being lost. After the transposition, the contents of both the forth column and the (implied) fourth row will contain (0,0,0,1).
If this is not the desired result, use the contents of this matrix to populate either an instance of CC3ProjectionMatrix, or a CC3Matrix4x4 structure, and take the transpose of that matrix.
Implements CC3Matrix.