OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Skybox::Matrix Class Reference

Functions for manipulating matrices. More...

#include <Matrix.h>

Public Member Functions

floatgetAsArray (void)
 Get the matrix elements as a column major order array. More...
 
 Matrix (void)
 Default constructor. More...
 
Matrixoperator= (const Matrix &another)
 Overloading assingment operater to do deep copy of the Matrix elements. More...
 
 Matrix (const float *array)
 Constructor from element array. More...
 

Static Public Member Functions

static Matrix matrixOrthographic (float left, float right, float bottom, float top, float zNear, float zFar)
 Create and return an orthographic projection matrix. More...
 

Static Public Attributes

static Matrix identityMatrix = Matrix(identityArray)
 The identity matrix. More...
 

Private Attributes

float elements [16]
 A 16 element floating point array used to represent a 4x4 matrix. More...
 

Static Private Attributes

static const float identityArray []
 A 4x4 identity Matrix;. More...
 

Detailed Description

Functions for manipulating matrices.

Definition at line 29 of file Matrix.h.

Constructor & Destructor Documentation

Skybox::Matrix::Matrix ( void  )

Default constructor.

Definition at line 49 of file Matrix.cpp.

Skybox::Matrix::Matrix ( const float array)

Constructor from element array.

Parameters
[in]arrayA column major order array to use as the matrix elements.

Definition at line 40 of file Matrix.cpp.

Member Function Documentation

float * Skybox::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.

Matrix Skybox::Matrix::matrixOrthographic ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
static

Create and return an orthographic projection matrix.

Assumes Z is positive going away from the user's view (left-hand coordinate system).

Parameters
[in]leftThe coordinate for the left vertical clipping plane.
[in]rightThe coordinate for the right vertical clipping plane.
[in]bottomThe coordinate for the bottom horizontal clipping plane.
[in]topThe coordinate for the top horizontal clipping plane.
[in]zNearThe distance from the camera to the near clipping plane.
[in]zFarthe distance from the camera to the far clipping plane.
Returns
An orthographic projection matrix.

Definition at line 69 of file Matrix.cpp.

Matrix & Skybox::Matrix::operator= ( const Matrix another)

Overloading assingment operater to do deep copy of the Matrix elements.

Definition at line 58 of file Matrix.cpp.

Member Data Documentation

float Skybox::Matrix::elements[16]
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.

const float Skybox::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 41 of file Matrix.h.

Matrix Skybox::Matrix::identityMatrix = Matrix(identityArray)
static

The identity matrix.

A matrix with 1's on the main diagonal and 0's everywhere else.

Definition at line 73 of file Matrix.h.


The documentation for this class was generated from the following files: