sgMatrix4x4 Class Reference

#include <sgMatrix4x4.h>

List of all members.

Public Member Functions

 sgMatrix4x4 ()
 sgMatrix4x4 (const sgMatrix4x4 &other)
 sgMatrix4x4 (float *other)
bool operator== (const sgMatrix4x4 &other)
bool operator!= (const sgMatrix4x4 &other)
sgMatrix4x4operator= (const sgMatrix4x4 &other)
sgMatrix4x4operator= (float *other)
sgMatrix4x4 operator* (const sgMatrix4x4 &other)
sgMatrix4x4operator*= (const sgMatrix4x4 &other)
sgVector4 operator* (const sgVector4 &other)
sgVector3 operator* (const sgVector3 &other)
void set (float *other)
void makeIdentity ()
void makeProjectionOrtho (float left, float right, float bottom, float top, float clipnear, float clipfar)
void makeProjectionPersp (float arc, float aspect, float clipnear, float clipfar)
void makeTranslate (const sgVector4 &trans)
void makeTranslate (const sgVector3 &trans)
void makeScale (const sgVector4 &scal)
void makeScale (const sgVector3 &scal)
void makeRotate (const sgVector4 &rot)
void makeRotate (const sgVector3 &rot)
void makeRotate (const sgQuaternion &rot)
void translate (const sgVector4 &trans)
void translate (const sgVector3 &trans)
void scale (const sgVector4 &scal)
void scale (const sgVector3 &scal)
void rotate (const sgVector4 &rot)
void rotate (const sgVector3 &rot)
void rotate (const sgQuaternion &rot)
void transpose ()
sgVector4 transform (const sgVector4 &other)
sgVector3 transform (const sgVector3 &other)

Public Attributes

float mat [16]

Detailed Description

Matrix class. Stores a 4x4 matrix and provides functionality for it. A matrix is stored as column major!


Constructor & Destructor Documentation

sgMatrix4x4::sgMatrix4x4 (  ) 

Constructor. Initializes a new instance as identity matrix.

sgMatrix4x4::sgMatrix4x4 ( const sgMatrix4x4 other  ) 

Constructor. Initializes a new instance from the given matrix.

Parameters:
other the other matrix to copy the values from
sgMatrix4x4::sgMatrix4x4 ( float *  other  ) 

Constructor. Initializes a new instance from a matrix given by an array.

Parameters:
other pointer to the first element of the matrix array (column major!)

Member Function Documentation

void sgMatrix4x4::makeIdentity (  ) 

Make identity matrix. Sets the matrix to the identity matrix.

void sgMatrix4x4::makeProjectionOrtho ( float  left,
float  right,
float  bottom,
float  top,
float  clipnear,
float  clipfar 
)

Make orthogonal projection matrix. Sets the matrix to the orthogonal projection matrix defined by the parameters.

Parameters:
left the left clipping plane
right the right clipping plane
bottom the bottom clipping plane
top the top clipping plane
clipnear the near clipping plane
clipfar the far clipping plane
void sgMatrix4x4::makeProjectionPersp ( float  arc,
float  aspect,
float  clipnear,
float  clipfar 
)

Make perspective projection matrix. Sets the matrix to the perspective projection matrix defined by the parameters.

Parameters:
arc the horizontal opening angle of the camera
aspect the aspect ratio
clipnear the near clipping plane
clipfar the far clipping plane
void sgMatrix4x4::makeRotate ( const sgQuaternion rot  ) 

Make rotation matrix. Sets the matrix to the rotation defined by the parameter.

Parameters:
rot the rotation to create a transformation matrix for as quaternion
void sgMatrix4x4::makeRotate ( const sgVector3 rot  ) 

Make rotation matrix. Sets the matrix to the rotation defined by the parameter.

Parameters:
rot the rotation to create a transformation matrix for as euler angles
void sgMatrix4x4::makeRotate ( const sgVector4 rot  ) 

Make rotation matrix. Sets the matrix to the rotation defined by the parameter.

Parameters:
rot the rotation to create a transformation matrix for in axis angle format
void sgMatrix4x4::makeScale ( const sgVector3 scal  ) 

Make scale matrix. Sets the matrix to the scaling defined by the parameter.

Parameters:
scal the scale to create a transformation matrix for
void sgMatrix4x4::makeScale ( const sgVector4 scal  ) 

Make scale matrix. Sets the matrix to the scaling defined by the parameter.

Parameters:
scal the scale to create a transformation matrix for
void sgMatrix4x4::makeTranslate ( const sgVector3 trans  ) 

Make translation matrix. Sets the matrix to the translation defined by the parameter.

Parameters:
trans the translation to create a transformation matrix for
void sgMatrix4x4::makeTranslate ( const sgVector4 trans  ) 

Make translation matrix. Sets the matrix to the translation defined by the parameter.

Parameters:
trans the translation to create a transformation matrix for
bool sgMatrix4x4::operator!= ( const sgMatrix4x4 other  ) 

Not equal. Checks if two instances do not equal each other.

sgVector3 sgMatrix4x4::operator* ( const sgVector3 other  ) 

Multiply. Transforms the vector with the matrix, by multiplying them with the matrix on the left.

sgVector4 sgMatrix4x4::operator* ( const sgVector4 other  ) 

Multiply. Transforms the vector with the matrix, by multiplying them with the matrix on the left.

sgMatrix4x4 sgMatrix4x4::operator* ( const sgMatrix4x4 other  ) 

Multiply. Multiply the two matrices.

sgMatrix4x4 & sgMatrix4x4::operator*= ( const sgMatrix4x4 other  ) 

Multiply. Multiply the two matrices.

sgMatrix4x4 & sgMatrix4x4::operator= ( float *  other  ) 

Copy. Copy the values from the matrix array (column major!) to the matrix.

sgMatrix4x4 & sgMatrix4x4::operator= ( const sgMatrix4x4 other  ) 

Copy. Copy the values of one instance to the other.

bool sgMatrix4x4::operator== ( const sgMatrix4x4 other  ) 

Equal. Checks if two instances equal each other.

void sgMatrix4x4::rotate ( const sgQuaternion rot  ) 

Rotate the matrix. Applies the rotation given by the parameter to the matrix.

Parameters:
rot the translation to apply as quaternion
void sgMatrix4x4::rotate ( const sgVector3 rot  ) 

Rotate the matrix. Applies the rotation given by the parameter to the matrix.

Parameters:
rot the translation to apply as euler angles
void sgMatrix4x4::rotate ( const sgVector4 rot  ) 

Rotate the matrix. Applies the rotation given by the parameter to the matrix.

Parameters:
rot the translation to apply in axis angle format
void sgMatrix4x4::scale ( const sgVector3 scal  ) 

Scale the matrix. Applies the scaling given by the parameter to the matrix.

Parameters:
scal the scaling to apply
void sgMatrix4x4::scale ( const sgVector4 scal  ) 

Scale the matrix. Applies the scaling given by the parameter to the matrix.

Parameters:
scal the scaling to apply
void sgMatrix4x4::set ( float *  other  ) 

Set to array. Copy the values from the given matrix array (column major!) to the matrix.

Parameters:
other pointer to first element of the matrix array
sgVector3 sgMatrix4x4::transform ( const sgVector3 other  ) 

Transform. Transforms a vector with the matrix by multiplying them with the matrix on the left.

Parameters:
other the vector to transform
sgVector4 sgMatrix4x4::transform ( const sgVector4 other  ) 

Transform. Transforms a vector with the matrix by multiplying them with the matrix on the left.

Parameters:
other the vector to transform
void sgMatrix4x4::translate ( const sgVector3 trans  ) 

Translate the matrix. Applies the translation given by the parameter to the matrix.

Parameters:
trans the translation to apply
void sgMatrix4x4::translate ( const sgVector4 trans  ) 

Translate the matrix. Applies the translation given by the parameter to the matrix.

Parameters:
trans the translation to apply
void sgMatrix4x4::transpose (  ) 

Transpose. Swap columns and rows.


Member Data Documentation

float sgMatrix4x4::mat[16]

Matrix array. Array of the matrix components as column major.


The documentation for this class was generated from the following files:
Generated on Thu Jun 3 13:31:04 2010 for iSDGE by  doxygen 1.6.3