Visit Cem Yuksel's web site

Files

Class List

Class Members

Class Hierarchy

cyMatrix3f Class Reference

#include <cyMatrix3.h>

List of all members.


Detailed Description

3x3 matrix class.

Its data stores 9-value array of column-major matrix elements. You can use cyMatrix3f with cyPoint3f to transform 3D points. Both post-multiplication and pre-multiplication are supported.


Other Public Methods

void SetTranspose ()
 Transpose this matrix.
cyMatrix3f Transpose () const
 return Transpose of this matrix
void Invert ()
 Invert this matrix.
void GetInverse (cyMatrix3f &inverse)
 Get the inverse of this matrix.
cyMatrix3f GetInverse ()
 Get the inverse of this matrix.

Public Member Functions

Constructors
 cyMatrix3f ()
 Default constructor.
 cyMatrix3f (const cyMatrix3f &matrix)
 Copy constructor.
 cyMatrix3f (const cyPoint3f &p)
 Matrix formulation of the cross product.
Set & Get Methods
void Zero ()
 Set all the values as zero.
void Set (const float *array)
 Set Matrix using an array of 9 values.
void Set (const cyPoint3f &p)
 Matrix formulation of the cross product.
void Set (const cyPoint3f &x, const cyPoint3f &y, const cyPoint3f &z)
 Set Matrix using x,y,z vectors and coordinate center.
void SetIdentity ()
 Converts the matrix to an identity matrix.
void SetView (const cyPoint3f &target, cyPoint3f &up)
 Set View Matrix using position, target and approximate up vector.
void SetNormal (const cyPoint3f &normal, cyPoint3f &dir)
 Set Matrix using normal, and approximate x direction.
void SetRotationX (float theta)
 Set as rotation matrix around x axis.
void SetRotationY (float theta)
 Set as rotation matrix around y axis.
void SetRotationZ (float theta)
 Set as rotation matrix around z axis.
void SetRotation (cyPoint3f axis, float theta)
 Set a rotation matrix about the given axis by angle theta.
void SetRotation (cyPoint3f axis, float cosTheta, float sinTheta)
 Set a rotation matrix about the given axis by cos and sin of angle theta.
void SetRotation (cyPoint3f from, cyPoint3f to)
 Set a rotation matrix that sets <from> unit vector to <to> unit vector.
cyPoint3f GetRow (int row) const
 Set all the values as zero.
void GetRow (int row, cyPoint3f &p) const
 Set all the values as zero.
void GetRow (int row, float *array) const
 Set all the values as zero.
cyPoint3f GetColumn (int col) const
 Set all the values as zero.
void GetColumn (int col, cyPoint3f &p) const
 Set all the values as zero.
void GetColumn (int col, float *array) const
 Set all the values as zero.
Overloaded Operators
const cyMatrix3foperator= (const cyMatrix3f &)
 assign matrix
bool operator== (const cyMatrix3f &) const
 compare equal
bool operator!= (const cyMatrix3f &right) const
 compare not equal
float & operator() (int row, int column)
 subscript operator
float & operator[] (int i)
 subscript operator
const float & operator() (int row, int column) const
 constant subscript operator
const float & operator[] (int i) const
 constant subscript operator
cyMatrix3f operator- () const
 negative matrix
cyMatrix3f operator+ (const cyMatrix3f &) const
 add two Matrices
cyMatrix3f operator- (const cyMatrix3f &) const
 subtract one cyMatrix3f from an other
cyMatrix3f operator * (const cyMatrix3f &) const
 multiply a matrix with an other
cyMatrix3f operator+ (const float) const
 add a value to a matrix
cyMatrix3f operator- (const float) const
 subtract a value from a matrix
cyMatrix3f operator * (const float) const
 multiple matrix by a value
cyMatrix3f operator/ (const float) const
 divide matrix by a value;
cyPoint3f operator * (const cyPoint3f &p) const
 assign matrix
void operator+= (const cyMatrix3f &)
 add two Matrices modify this
void operator-= (const cyMatrix3f &)
 subtract one cyMatrix3f from an other modify this matrix
void operator *= (const cyMatrix3f &)
 multiply a matrix with an other modify this matrix
void operator+= (const float)
 add a value to a matrix modify this
void operator-= (const float)
 subtract a value from a matrix modify this matrix
void operator *= (const float)
 multiply a matrix with a value modify this matrix
void operator/= (const float)
 divide the matrix by a value modify the this matrix

Public Attributes

float data [9]
 elements of the matrix are column-major

Friends

cyMatrix3f operator+ (const float, const cyMatrix3f &)
 add a value to a matrix
cyMatrix3f operator- (const float, const cyMatrix3f &)
 subtract the matrix from a value
cyMatrix3f operator * (const float, const cyMatrix3f &)
 multiple matrix by a value
cyMatrix3f Inverse (cyMatrix3f &m)
 return the inverse of the matrix
cyPoint3f operator * (const cyPoint3f &, const cyMatrix3f &)
 pre-multiply with a 3D point

Visit Cem Yuksel's website!