Functions for manipulating matrices.
More...
#include <Matrix.h>
|
static Matrix | createRotationX (float angle) |
| Create and return a rotation matrix around the x-axis matrix. More...
|
|
static Matrix | createRotationY (float angle) |
| Create and return a rotation matrix around the y-axis matrix. More...
|
|
static Matrix | createRotationZ (float angle) |
| Create and return a rotation matrix around the z-axis matrix. More...
|
|
static Matrix | matrixOrthographic (float left, float right, float bottom, float top, float zNear, float zFar) |
| Create and return an orthographic projection matrix. More...
|
|
static Matrix | matrixPerspective (float FOV, float ratio, float zNear, float zFar) |
| Create and return a perspective projection matrix. More...
|
|
static Matrix | createRotationX (float angle) |
| Create and return a rotation matrix around the x-axis matrix. More...
|
|
static Matrix | createRotationY (float angle) |
| Create and return a rotation matrix around the y-axis matrix. More...
|
|
static Matrix | createRotationZ (float angle) |
| Create and return a rotation matrix around the z-axis matrix. More...
|
|
static Matrix | matrixOrthographic (float left, float right, float bottom, float top, float zNear, float zFar) |
| Create and return an orthographic projection matrix. More...
|
|
static Matrix | matrixPerspective (float FOV, float ratio, float zNear, float zFar) |
| Create and return a perspective projection matrix. More...
|
|
Functions for manipulating matrices.
Definition at line 29 of file Matrix.h.
AstcTextures::Matrix::Matrix |
( |
void |
| ) |
|
Default constructor.
Definition at line 49 of file Matrix.cpp.
AstcTextures::Matrix::Matrix |
( |
const float * |
array | ) |
|
Constructor from element array.
- Parameters
-
[in] | array | A column major order array to use as the matrix elements. |
Definition at line 40 of file Matrix.cpp.
AstcTextures::Matrix::Matrix |
( |
void |
| ) |
|
AstcTextures::Matrix::Matrix |
( |
const float * |
array | ) |
|
Constructor from element array.
- Parameters
-
[in] | array | A column major order array to use as the matrix elements. |
Matrix AstcTextures::Matrix::createRotationX |
( |
float |
angle | ) |
|
|
static |
Create and return a rotation matrix around the x-axis matrix.
- Parameters
-
[in] | angle | Angle of rotation (in degrees). |
- Returns
- A rotation matrix around the x-axis matrix with the required angle of rotation.
Definition at line 121 of file Matrix.cpp.
static Matrix AstcTextures::Matrix::createRotationX |
( |
float |
angle | ) |
|
|
static |
Create and return a rotation matrix around the x-axis matrix.
- Parameters
-
[in] | angle | Angle of rotation (in degrees). |
- Returns
- A rotation matrix around the x-axis matrix with the required angle of rotation.
static Matrix AstcTextures::Matrix::createRotationY |
( |
float |
angle | ) |
|
|
static |
Create and return a rotation matrix around the y-axis matrix.
- Parameters
-
[in] | angle | Angle of rotation (in degrees). |
- Returns
- A rotation matrix around the y-axis matrix with the required angle of rotation.
Matrix AstcTextures::Matrix::createRotationY |
( |
float |
angle | ) |
|
|
static |
Create and return a rotation matrix around the y-axis matrix.
- Parameters
-
[in] | angle | Angle of rotation (in degrees). |
- Returns
- A rotation matrix around the y-axis matrix with the required angle of rotation.
Definition at line 135 of file Matrix.cpp.
Matrix AstcTextures::Matrix::createRotationZ |
( |
float |
angle | ) |
|
|
static |
Create and return a rotation matrix around the z-axis matrix.
- Parameters
-
[in] | angle | Angle of rotation (in degrees). |
- Returns
- A rotation matrix around the z-axis matrix with the required angle of rotation.
Definition at line 149 of file Matrix.cpp.
static Matrix AstcTextures::Matrix::createRotationZ |
( |
float |
angle | ) |
|
|
static |
Create and return a rotation matrix around the z-axis matrix.
- Parameters
-
[in] | angle | Angle of rotation (in degrees). |
- Returns
- A rotation matrix around the z-axis matrix with the required angle of rotation.
float* AstcTextures::Matrix::getAsArray |
( |
void |
| ) |
|
Get the matrix elements as a column major order array.
- Returns
- A pointer to the matrix elements.
float * AstcTextures::Matrix::getAsArray |
( |
void |
| ) |
|
Get the matrix elements as a column major order array.
- Returns
- A pointer to the matrix elements.
Definition at line 52 of file Matrix.cpp.
Create and return an orthographic projection matrix.
Assumes Z is positive going away from the user's view (left-hand coordinate system).
- Parameters
-
[in] | left | The coordinate for the left vertical clipping plane. |
[in] | right | The coordinate for the right vertical clipping plane. |
[in] | bottom | The coordinate for the bottom horizontal clipping plane. |
[in] | top | The coordinate for the top horizontal clipping plane. |
[in] | zNear | The distance from the camera to the near clipping plane. |
[in] | zFar | the distance from the camera to the far clipping plane. |
- Returns
- An orthographic projection matrix.
Definition at line 87 of file Matrix.cpp.
Create and return an orthographic projection matrix.
Assumes Z is positive going away from the user's view (left-hand coordinate system).
- Parameters
-
[in] | left | The coordinate for the left vertical clipping plane. |
[in] | right | The coordinate for the right vertical clipping plane. |
[in] | bottom | The coordinate for the bottom horizontal clipping plane. |
[in] | top | The coordinate for the top horizontal clipping plane. |
[in] | zNear | The distance from the camera to the near clipping plane. |
[in] | zFar | the distance from the camera to the far clipping plane. |
- Returns
- An orthographic projection matrix.
Create and return a perspective projection matrix.
- Parameters
-
[in] | FOV | The field of view angle (in degrees) in the y direction. |
[in] | ratio | The ratio used to calculate the field of view in the x direction. The ratio of x (width) to y (height). |
[in] | zNear | The distance from the camera to the near clipping plane. |
[in] | zFar | the distance from the camera to the far clipping plane. |
- Returns
- A perspective projection matrix.
Definition at line 104 of file Matrix.cpp.
Create and return a perspective projection matrix.
- Parameters
-
[in] | FOV | The field of view angle (in degrees) in the y direction. |
[in] | ratio | The ratio used to calculate the field of view in the x direction. The ratio of x (width) to y (height). |
[in] | zNear | The distance from the camera to the near clipping plane. |
[in] | zFar | the distance from the camera to the far clipping plane. |
- Returns
- A perspective projection matrix.
Multiply 2 matrices to return a third.
- Note
- When multiplying matrices the ordering of the parameters affects the result.
- Parameters
-
[in] | left | First matrix to multiply. |
[in] | right | Second matrix to multiply. |
- Returns
- The result of left * right
Multiply 2 matrices to return a third.
- Note
- When multiplying matrices the ordering of the parameters affects the result.
- Parameters
-
[in] | left | First matrix to multiply. |
[in] | right | Second matrix to multiply. |
- Returns
- The result of left * right
Definition at line 163 of file Matrix.cpp.
Multiply operator to post multiply a matrix by another.
- Parameters
-
[in] | right | The matrix to post multiply by. |
- Returns
- The result of matrix * right.
Definition at line 70 of file Matrix.cpp.
Multiply operator to post multiply a matrix by another.
- Parameters
-
[in] | right | The matrix to post multiply by. |
- Returns
- The result of matrix * right.
Matrix & AstcTextures::Matrix::operator= |
( |
const Matrix & |
another | ) |
|
Overloading assingment operater to do deep copy of the Matrix elements.
Definition at line 76 of file Matrix.cpp.
Matrix& AstcTextures::Matrix::operator= |
( |
const Matrix & |
another | ) |
|
Overloading assingment operater to do deep copy of the Matrix elements.
float& AstcTextures::Matrix::operator[] |
( |
unsigned |
element | ) |
|
Array operator for accessing the elements of the matrix.
- Parameters
-
[in] | element | The element index of the matrix (accepts 0-15). |
- Returns
- The element of the matrix.
float & AstcTextures::Matrix::operator[] |
( |
unsigned |
element | ) |
|
Array operator for accessing the elements of the matrix.
- Parameters
-
[in] | element | The element index of the matrix (accepts 0-15). |
- Returns
- The element of the matrix.
Definition at line 58 of file Matrix.cpp.
float AstcTextures::Matrix::elements |
|
private |
A 16 element floating point array used to represent a 4x4 matrix.
- Note
- Items are stored in column major order as OpenGL ES expects them.
Definition at line 36 of file Matrix.h.
static const float AstcTextures::Matrix::identityArray |
|
staticprivate |
Initial value:=
{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
}
A 4x4 identity Matrix;.
Definition at line 51 of file Matrix.h.
The identity matrix.
A matrix with 1's on the main diagonal and 0's everywhere else.
Definition at line 99 of file Matrix.h.
The documentation for this class was generated from the following files:
- /mnt/d/working/gitlab/opengles-sdk-android/samples/advanced_samples/AstcTextures/jni/Matrix.h
- /mnt/d/working/gitlab/opengles-sdk-android/samples/advanced_samples/AstcTextures/jni/Matrix.cpp