Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Moteur3D::Matrix2 Class Reference

Matrix2 handles 2D matrix operations. More...

#include <Matrix2.h>

List of all members.

Public Member Functions

 Matrix2 ()
 Default constructor. Does NOT initialise data for performance.
 Matrix2 (const Matrix2 &m)
 Copy Constructor.
 Matrix2 (const Vector2 &v1, const Vector2 &v2)
 Builds a matrix from 2 vectors that serve as columns.
 Matrix2 (const float m00, const float m10, const float m01, const float m11)
 Builds a matrix from 4 values. m00 and m10 are the first column, while m01 and m11 are the second one.
 Matrix2 (const float values[2][2])
 Builds a matrix from an array of values.
TestResult Test ()
 Tests this class and returns the result in a TestResult structure.
std::string ToString ()
 Returns a string that represents the actual object.
const Vector2operator[] (unsigned int col)
 Array indexing operator.
const Vector2operator[] (unsigned int col) const
 Array indexing operator.
Matrix2operator= (const Matrix2 &m)
 Assign operator.
Matrix2operator+= (const Matrix2 &m)
 Adds a Matrix2 to this one.
Matrix2operator-= (const Matrix2 &m)
 Subtracts a Matrix2 from this one.
Matrix2operator *= (const Matrix2 &m)
 Multiplies the Matrix2 by another Matrix2.
Matrix2operator *= (float f)
 Multiplies the Matrix2 by a float.
Matrix2operator/= (float f)
 Divides the Matrix2 by a float.

Protected Attributes

float mat2 [2][2]

Friends

bool operator== (const Matrix2 &m1, const Matrix2 &m2)
 Are these two Matrix2's equal ?
bool operator!= (const Matrix2 &m1, const Matrix2 &m2)
 Are these two Matrix2's not equal ?
Matrix2 operator+ (const Matrix2 &m1, const Matrix2 &m2)
 Add two Matrix2's.
Matrix2 operator- (const Matrix2 &m1, const Matrix2 &m2)
 Subtracts one Matrix2 from another.
Matrix2 operator * (const Matrix2 &m1, const Matrix2 &m2)
 Multiplies a Matrix2 by another one.
Vector2 operator * (const Matrix2 &m, const Vector2 &v)
 Multiplies a Matrix2 by a Vector2.
Vector2 operator * (const Vector2 &v, const Matrix2 &m)
 Multiplies a Vector2 by a Matrix2.
Matrix2 operator * (const Matrix2 &m, float f)
 Multiplies a Matrix2 by a float.
Matrix2 operator * (float f, const Matrix2 &m)
 Multiplies a Matrix2 by a float.


Detailed Description

Matrix2 handles 2D matrix operations.


Constructor & Destructor Documentation

Moteur3D::Matrix2::Matrix2  )  [inline]
 

Default constructor. Does NOT initialise data for performance.

Note that internally data is stored column-wise.

Moteur3D::Matrix2::Matrix2 const Matrix2 m  ) 
 

Copy Constructor.

Moteur3D::Matrix2::Matrix2 const Vector2 v1,
const Vector2 v2
 

Builds a matrix from 2 vectors that serve as columns.

Moteur3D::Matrix2::Matrix2 const float  m00,
const float  m10,
const float  m01,
const float  m11
 

Builds a matrix from 4 values. m00 and m10 are the first column, while m01 and m11 are the second one.

Moteur3D::Matrix2::Matrix2 const float  values[2][2]  ) 
 

Builds a matrix from an array of values.

Parameters:
values 2x2 array of values.


Member Function Documentation

Matrix2& Moteur3D::Matrix2::operator *= float  f  )  [inline]
 

Multiplies the Matrix2 by a float.

Matrix2& Moteur3D::Matrix2::operator *= const Matrix2 m  ) 
 

Multiplies the Matrix2 by another Matrix2.

Matrix2& Moteur3D::Matrix2::operator+= const Matrix2 m  )  [inline]
 

Adds a Matrix2 to this one.

Matrix2& Moteur3D::Matrix2::operator-= const Matrix2 m  )  [inline]
 

Subtracts a Matrix2 from this one.

Matrix2& Moteur3D::Matrix2::operator/= float  f  )  [inline]
 

Divides the Matrix2 by a float.

Matrix2& Moteur3D::Matrix2::operator= const Matrix2 m  )  [inline]
 

Assign operator.

const Vector2* Moteur3D::Matrix2::operator[] unsigned int  col  )  const [inline]
 

Array indexing operator.

const Vector2* Moteur3D::Matrix2::operator[] unsigned int  col  )  [inline]
 

Array indexing operator.

TestResult Moteur3D::Matrix2::Test  ) 
 

Tests this class and returns the result in a TestResult structure.

Returns:
Testresult structure that holds the success (or not) of the test as well as remarks about the success or failure.

std::string Moteur3D::Matrix2::ToString  ) 
 

Returns a string that represents the actual object.

Returns:
see brief :)


Friends And Related Function Documentation

Matrix2 operator * float  f,
const Matrix2 m
[friend]
 

Multiplies a Matrix2 by a float.

Matrix2 operator * const Matrix2 m,
float  f
[friend]
 

Multiplies a Matrix2 by a float.

Vector2 operator * const Vector2 v,
const Matrix2 m
[friend]
 

Multiplies a Vector2 by a Matrix2.

Vector2 operator * const Matrix2 m,
const Vector2 v
[friend]
 

Multiplies a Matrix2 by a Vector2.

Matrix2 operator * const Matrix2 m1,
const Matrix2 m2
[friend]
 

Multiplies a Matrix2 by another one.

bool operator!= const Matrix2 m1,
const Matrix2 m2
[friend]
 

Are these two Matrix2's not equal ?

Matrix2 operator+ const Matrix2 m1,
const Matrix2 m2
[friend]
 

Add two Matrix2's.

Matrix2 operator- const Matrix2 m1,
const Matrix2 m2
[friend]
 

Subtracts one Matrix2 from another.

bool operator== const Matrix2 m1,
const Matrix2 m2
[friend]
 

Are these two Matrix2's equal ?


Member Data Documentation

float Moteur3D::Matrix2::mat2[2][2] [protected]
 


The documentation for this class was generated from the following file:
Generated on Sat Oct 15 15:05:51 2005 for Moteur3D by  doxygen 1.4.4