MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Mezzanine::Matrix3x3 Class Reference

This is a 3x3 Matrix class used for representing rotations and scaling in an object. More...

#include <matrix3x3.h>

Public Member Functions

 Matrix3x3 ()
 Non-Initialization constructor.
 
 Matrix3x3 (const Real &XX, const Real &XY, const Real &XZ, const Real &YX, const Real &YY, const Real &YZ, const Real &ZX, const Real &ZY, const Real &ZZ)
 Explict Initialization constructor. More...
 
 Matrix3x3 (const Real &Yaw, const Real &Pitch, const Real &Roll)
 Euler Initialization constructor. More...
 
 Matrix3x3 (const Quaternion &Rot)
 Quaternion Initialization constructor. More...
 
 Matrix3x3 (const Vector3 &Axis, const Real &Angle)
 Axis Angle Initialization constructor. More...
 
 Matrix3x3 (const btMatrix3x3 &Mat)
 Bullet Matrix3x3 constructor. More...
 
 Matrix3x3 (const Ogre::Matrix3 &Mat)
 Ogre Matrix3x3 constructor. More...
 
 ~Matrix3x3 ()
 Class destructor.
 
Matrix3x3 Adjoint () const
 Gets the Adjoint of this Matrix. More...
 
Real CoFactor (const Whole &Row1, const Whole &Col1, const Whole &Row2, const Whole &Col2) const
 Gets the cofactor between two sets of rows/columns. More...
 
void ExtractBulletMatrix3x3 (const btMatrix3x3 &temp)
 Gets the data from a Bullet Matrix3x3 and applies it to this. More...
 
void ExtractOgreMatrix3x3 (const Ogre::Matrix3 &temp)
 Gets the data from an Ogre Matrix3x3 and applies it to this. More...
 
Quaternion GetAsQuaternion () const
 Gets this Matrix as a Quaternion. More...
 
btMatrix3x3 GetBulletMatrix3x3 () const
 Gets a Bullet copy of this Matrix3x3. More...
 
Real GetDeterminant () const
 Gets the Determinant of this Matrix. More...
 
Ogre::Matrix3 GetOgreMatrix3x3 () const
 Gets an Ogre copy of this Matrix3x3. More...
 
bool HasScaling () const
 Checks to see if this Matrix has any scaling applied to it. More...
 
Matrix3x3 Inverse () const
 Gets the Inverse of this Matrix. More...
 
bool operator!= (const Matrix3x3 &Other) const
 Inequality comparison operator. More...
 
Matrix3x3 operator* (const Matrix3x3 &Other) const
 Multiplication operator. More...
 
Vector3 operator* (const Vector3 &Vec) const
 Multiply by Vector3 operator. More...
 
Matrix3x3 operator* (const Real &Scaler) const
 Multiply by Real operator. More...
 
Matrix3x3operator*= (const Matrix3x3 &Other)
 Multiplication Assignment operator. More...
 
Matrix3x3operator*= (const Real &Scaler)
 Multiply Assignment by Real operator. More...
 
Matrix3x3 operator+ (const Matrix3x3 &Other) const
 Addition operator. More...
 
Matrix3x3operator+= (const Matrix3x3 &Other)
 Addition Assignment operator. More...
 
Matrix3x3 operator- (const Matrix3x3 &Other) const
 Subtraction operator. More...
 
Matrix3x3 operator- () const
 Negative Unary operator. More...
 
Matrix3x3operator-= (const Matrix3x3 &Other)
 Subtraction Assignment operator. More...
 
void operator= (const Matrix3x3 &Other)
 Assignment operator. More...
 
bool operator== (const Matrix3x3 &Other) const
 Equality comparison operator. More...
 
void SetFromAxisAngle (const Vector3 &Axis, const Real &Angle)
 Sets the Matrix from an Axis Angle. More...
 
void SetFromEulerZYX (const Real &Yaw, const Real &Pitch, const Real &Roll)
 Sets the Matrix based on Euler angles. More...
 
void SetFromQuaternion (const Quaternion &Rot)
 Sets the Matrix from a quaternion. More...
 
void SetIdentity ()
 Sets all values in this Matrix to Identity values. More...
 
void SetScale (const Vector3 &Scaling)
 Scales this Matrix. More...
 
void SetValues (const Real &XX, const Real &XY, const Real &XZ, const Real &YX, const Real &YY, const Real &YZ, const Real &ZX, const Real &ZY, const Real &ZZ)
 Sets the values for every number in the matrix.
 
void SetZero ()
 Sets all values in this Matrix to zero.
 
Matrix3x3 Transpose () const
 Gets the Transpose of this Matrix. More...
 

Public Attributes

Real Matrix [3][3]
 The Matrix. Fo' Reals.
 

Detailed Description

This is a 3x3 Matrix class used for representing rotations and scaling in an object.

The utility of this class overlaps with that of the Quaternion, for the most part the use of either class is a matter of preference. The Mezzanine engine for the most part prefer's use of the Quaternion class since it deals with fewer numbers, but this class is still made available for others that may prefer it.

Definition at line 62 of file matrix3x3.h.

Constructor & Destructor Documentation

Mezzanine::Matrix3x3::Matrix3x3 ( const Real XX,
const Real XY,
const Real XZ,
const Real YX,
const Real YY,
const Real YZ,
const Real ZX,
const Real ZY,
const Real ZZ 
)

Explict Initialization constructor.

Provides initialization for every number in the matrix.

Definition at line 64 of file matrix3x3.cpp.

Mezzanine::Matrix3x3::Matrix3x3 ( const Real Yaw,
const Real Pitch,
const Real Roll 
)

Euler Initialization constructor.

Parameters
YawThe number of degree's on the Yaw in Degrees to rotate.
PitchThe number of degree's on the Pitch in Degrees to rotate.
RollThe number of degree's on the Roll in Degrees to rotate.

Definition at line 69 of file matrix3x3.cpp.

Mezzanine::Matrix3x3::Matrix3x3 ( const Quaternion Rot)

Quaternion Initialization constructor.

Parameters
RotThe rotation to apply to this Matrix expressed as a Quaternion.

Definition at line 74 of file matrix3x3.cpp.

Mezzanine::Matrix3x3::Matrix3x3 ( const Vector3 Axis,
const Real Angle 
)

Axis Angle Initialization constructor.

Parameters
AxisThe axis on which to apply the rotation.
AngleThe amount of rotation to apply in Radians.

Definition at line 79 of file matrix3x3.cpp.

Mezzanine::Matrix3x3::Matrix3x3 ( const btMatrix3x3 &  Mat)

Bullet Matrix3x3 constructor.

Parameters
MatThe Bullet 3x3 Matrix.

Definition at line 84 of file matrix3x3.cpp.

Mezzanine::Matrix3x3::Matrix3x3 ( const Ogre::Matrix3 &  Mat)

Ogre Matrix3x3 constructor.

Parameters
MatThe Ogre 3x3 Matrix.

Definition at line 89 of file matrix3x3.cpp.

Member Function Documentation

Matrix3x3 Mezzanine::Matrix3x3::Adjoint ( ) const

Gets the Adjoint of this Matrix.

Returns
Returns a new Matrix3x3 that is the Adjoint of this.

Definition at line 460 of file matrix3x3.cpp.

Real Mezzanine::Matrix3x3::CoFactor ( const Whole Row1,
const Whole Col1,
const Whole Row2,
const Whole Col2 
) const

Gets the cofactor between two sets of rows/columns.

Parameters
Row1Row for the first Real of the calculated cofactor.
Col1Column for the first Real of the calculated cofactor.
Row2Row for the second Real of the calculated cofactor.
Col2Column for the second Real of the calculated cofactor.
Returns
Returns the CoFactor of the provided rows/columns.

Definition at line 494 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::ExtractBulletMatrix3x3 ( const btMatrix3x3 &  temp)

Gets the data from a Bullet Matrix3x3 and applies it to this.

Parameters
tempThe Matrix3x3 to copy from.

Definition at line 232 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::ExtractOgreMatrix3x3 ( const Ogre::Matrix3 &  temp)

Gets the data from an Ogre Matrix3x3 and applies it to this.

Parameters
tempThe Matrix3x3 to copy from.

Definition at line 254 of file matrix3x3.cpp.

Quaternion Mezzanine::Matrix3x3::GetAsQuaternion ( ) const

Gets this Matrix as a Quaternion.

Returns
Returns a Quaternion that expresses the same rotation as this Matrix.

Definition at line 198 of file matrix3x3.cpp.

btMatrix3x3 Mezzanine::Matrix3x3::GetBulletMatrix3x3 ( ) const

Gets a Bullet copy of this Matrix3x3.

Returns
Returns a Bullet Matrix3x3 with the same values as this Matrix3x3.

Definition at line 249 of file matrix3x3.cpp.

Real Mezzanine::Matrix3x3::GetDeterminant ( ) const

Gets the Determinant of this Matrix.

Returns
Returns a Real representing the Determinant of this Matrix.

Definition at line 187 of file matrix3x3.cpp.

Ogre::Matrix3 Mezzanine::Matrix3x3::GetOgreMatrix3x3 ( ) const

Gets an Ogre copy of this Matrix3x3.

Returns
Returns an Ogre Matrix3x3 with the same values as this Matrix3x3.

Definition at line 271 of file matrix3x3.cpp.

bool Mezzanine::Matrix3x3::HasScaling ( ) const

Checks to see if this Matrix has any scaling applied to it.

Returns
Returns true if this Matrix is scaled, false otherwise.

Definition at line 512 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::Inverse ( ) const

Gets the Inverse of this Matrix.

Returns
Returns a new Matrix3x3 that is this Matrix inversed.

Definition at line 467 of file matrix3x3.cpp.

bool Mezzanine::Matrix3x3::operator!= ( const Matrix3x3 Other) const

Inequality comparison operator.

Parameters
OtherThe other Matrix3x3 to compare against.
Returns
Returns true if the two Matrix3x3's are not equal, false otherwise.

Definition at line 292 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::operator* ( const Matrix3x3 Other) const

Multiplication operator.

Parameters
OtherThe other Matrix3x3 to multiply this by.
Returns
Returns a fresh Matrix3x3.

Definition at line 334 of file matrix3x3.cpp.

Vector3 Mezzanine::Matrix3x3::operator* ( const Vector3 Vec) const

Multiply by Vector3 operator.

Parameters
VecThe Vector to be rotated.
Returns
Returns a Vector3 with the rotation of this Matrix applied to it.

Definition at line 383 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::operator* ( const Real Scaler) const

Multiply by Real operator.

Parameters
ScalerThe Real to multiply each member of this Matrix by.
Returns
Returns a new Matrix3x3 that is a copy of this Matrix3x3 with each of it's members multiplied by the scaler.

Definition at line 394 of file matrix3x3.cpp.

Matrix3x3 & Mezzanine::Matrix3x3::operator*= ( const Matrix3x3 Other)

Multiplication Assignment operator.

Parameters
OtherThe other Matrix3x3 to add to this.
Returns
Returns a reference to *this.

Definition at line 374 of file matrix3x3.cpp.

Matrix3x3 & Mezzanine::Matrix3x3::operator*= ( const Real Scaler)

Multiply Assignment by Real operator.

Parameters
ScalerThe Real to multiply each member of this Matrix by.
Returns
Returns a reference to *this, being the modified Matrix3x3.

Definition at line 407 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::operator+ ( const Matrix3x3 Other) const

Addition operator.

Parameters
OtherThe other Matrix3x3 to add to this.
Returns
Returns a fresh Matrix3x3.

Definition at line 308 of file matrix3x3.cpp.

Matrix3x3 & Mezzanine::Matrix3x3::operator+= ( const Matrix3x3 Other)

Addition Assignment operator.

Parameters
OtherThe other Matrix3x3 to add to this.
Returns
Returns a reference to *this.

Definition at line 350 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::operator- ( const Matrix3x3 Other) const

Subtraction operator.

Parameters
OtherThe other Matrix3x3 to subtract from this.
Returns
Returns a fresh Matrix3x3.

Definition at line 321 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::operator- ( ) const

Negative Unary operator.

Returns
Returns a copy of this Matrix3x3 with each of it's members flipped.

Definition at line 433 of file matrix3x3.cpp.

Matrix3x3 & Mezzanine::Matrix3x3::operator-= ( const Matrix3x3 Other)

Subtraction Assignment operator.

Parameters
OtherThe other Matrix3x3 to subtract from this.
Returns
Returns a reference to *this.

Definition at line 362 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::operator= ( const Matrix3x3 Other)

Assignment operator.

Parameters
OtherThe other Matrix3x3 to copy from.

Definition at line 422 of file matrix3x3.cpp.

bool Mezzanine::Matrix3x3::operator== ( const Matrix3x3 Other) const

Equality comparison operator.

Parameters
OtherThe other Matrix3x3 to compare against.
Returns
Returns true if the two Matrix3x3's are equal, false otherwise.

Definition at line 279 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::SetFromAxisAngle ( const Vector3 Axis,
const Real Angle 
)

Sets the Matrix from an Axis Angle.

Parameters
AxisThe axis on which to apply the rotation.
AngleThe amount of rotation to apply in Radians.

Definition at line 144 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::SetFromEulerZYX ( const Real Yaw,
const Real Pitch,
const Real Roll 
)

Sets the Matrix based on Euler angles.

Parameters
YawThe number of degree's on the Yaw in Degrees to rotate.
PitchThe number of degree's on the Pitch in Degrees to rotate.
RollThe number of degree's on the Roll in Degrees to rotate.

Definition at line 110 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::SetFromQuaternion ( const Quaternion Rot)

Sets the Matrix from a quaternion.

Parameters
RotThe rotation to apply to this Matrix expressed as a Quaternion.

Definition at line 129 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::SetIdentity ( )

Sets all values in this Matrix to Identity values.

Identity values for a 4x4 matrix is all zeros except for the values at [0][0], [1][1], [2][2], [3][3], which are set to one.

Definition at line 170 of file matrix3x3.cpp.

void Mezzanine::Matrix3x3::SetScale ( const Vector3 Scaling)

Scales this Matrix.

Parameters
ScalingA Vector3 containing the scaling to be applied to this Matrix.

Definition at line 499 of file matrix3x3.cpp.

Matrix3x3 Mezzanine::Matrix3x3::Transpose ( ) const

Gets the Transpose of this Matrix.

Todo:
I'm not gonna lie, I have no idea what the hell the Transpose of a 3x3 Matrix is or what it is used for...this doc could use a touchup. In fact most of the doc's on this class could use a review.
Returns
Returns a new Matrix3x3 that is a Transposed copy of this.

Definition at line 449 of file matrix3x3.cpp.


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