Classes | Defines | Typedefs | Functions

matrix3.h File Reference

#include "GeomExport.h"
#include "maxheap.h"
#include "ioapi.h"
#include "point3.h"
#include "point4.h"

Go to the source code of this file.

Classes

class   Matrix3

Defines

#define  POS_IDENT   1
#define  ROT_IDENT   2
#define  SCL_IDENT   4
#define  MAT_IDENT   (POS_IDENT|ROT_IDENT|SCL_IDENT)

Typedefs

typedef float  MRow [3]

Functions

GEOMEXPORT Matrix3  RotateXMatrix (float angle)
GEOMEXPORT Matrix3  RotateYMatrix (float angle)
GEOMEXPORT Matrix3  RotateZMatrix (float angle)
GEOMEXPORT Matrix3  TransMatrix (const Point3 &p)
GEOMEXPORT Matrix3  ScaleMatrix (const Point3 &s)
GEOMEXPORT Matrix3  RotateYPRMatrix (float Yaw, float Pitch, float Roll)
GEOMEXPORT Matrix3  RotAngleAxisMatrix (Point3 &axis, float angle)
GEOMEXPORT Matrix3  Inverse (const Matrix3 &M)
GEOMEXPORT Point3  operator* (const Matrix3 &A, const Point3 &V)
GEOMEXPORT Point3  operator* (const Point3 &V, const Matrix3 &A)
GEOMEXPORT Point3  VectorTransform (const Matrix3 &M, const Point3 &V)
GEOMEXPORT Point3  VectorTransform (const Point3 &V, const Matrix3 &M)
GEOMEXPORT Point4  TransformPlane (const Matrix3 &M, const Point4 &plin)
GEOMEXPORT Matrix3  XFormMat (const Matrix3 &xm, const Matrix3 &m)

Define Documentation

#define POS_IDENT   1

Definition at line 22 of file matrix3.h.

#define ROT_IDENT   2

Definition at line 23 of file matrix3.h.

#define SCL_IDENT   4

Definition at line 24 of file matrix3.h.

#define MAT_IDENT   (POS_IDENT|ROT_IDENT|SCL_IDENT)

Definition at line 25 of file matrix3.h.


Typedef Documentation

typedef float MRow[3]

Definition at line 27 of file matrix3.h.


Function Documentation

GEOMEXPORT Matrix3 RotateXMatrix ( float  angle )
Remarks:
Builds a new matrix for use as a X rotation transformation.
Parameters:
float angle

Specifies the angle of rotation in radians.
Returns:
A new X rotation Matrix3.
GEOMEXPORT Matrix3 RotateYMatrix ( float  angle )
Remarks:
Builds a new matrix for use as a Y rotation transformation.
Parameters:
float angle

Specifies the angle of rotation in radians.
Returns:
A new Y rotation Matrix3.
GEOMEXPORT Matrix3 RotateZMatrix ( float  angle )
Remarks:
Builds a new matrix for use as a Z rotation transformation.
Parameters:
float angle

Specifies the angle of rotation in radians.
Returns:
A new Z rotation Matrix3.
GEOMEXPORT Matrix3 TransMatrix ( const Point3 p )
Remarks:
Builds a new matrix for use as a translation transformation.
Parameters:
const Point3& p

Specifies the translation values.
Returns:
A new translation Matrix3.
GEOMEXPORT Matrix3 ScaleMatrix ( const Point3 s )
Remarks:
Builds a new matrix for use as a scale transformation.
Parameters:
const Point3& p

Specifies the scale values.
Returns:
A new scale Matrix3.
GEOMEXPORT Matrix3 RotateYPRMatrix ( float  Yaw,
float  Pitch,
float  Roll 
)
Remarks:
Builds a new matrix for use as a rotation transformation by specifying yaw, pitch and roll angles.

This definition will depend on what our coordinate system is. This one is equivalent to:

M.IdentityMatrix();

M.RotateZ(roll);

M.RotateX(pitch);

M.RotateY(yaw);

Which presupposes Y is vertical, X is sideways, Z is forward
Parameters:
float Yaw

Specifies the yaw angle in radians.

float Pitch

Specifies the pitch angle in radians.

float Roll

Specifies the roll angle in radians.
Returns:
A new rotation Matrix3.
GEOMEXPORT Matrix3 RotAngleAxisMatrix ( Point3 axis,
float  angle 
)
Remarks:
Builds a new matrix for use as a rotation transformation by specifying an angle and axis.
Parameters:
Point3& axis

Specifies the axis of rotation. Note that this angle is expected to be normalized.

float angle

Specifies the angle of rotation. Note: The direction of the angle in this method is opposite of that in AngAxisFromQ().
Returns:
A new rotation Matrix3.
GEOMEXPORT Matrix3 Inverse ( const Matrix3 M )
Remarks:
Return the inverse of the matrix
Parameters:
const Matrix3& M

The matrix to compute the inverse of.
GEOMEXPORT Point3 operator* ( const Matrix3 A,
const Point3 V 
)
Remarks:
These transform a Point3 with a Matrix3. These two versions of transforming a point with a matrix do the same thing, regardless of the order of operands (linear algebra rules notwithstanding).
Parameters:
const Matrix3& A

The matrix to transform the point with. const Point3& V

The point to transform.

Returns:
The transformed Point3.
GEOMEXPORT Point3 operator* ( const Point3 V,
const Matrix3 A 
)
Remarks:
These transform a Point3 with a Matrix3. These two versions of transforming a point with a matrix do the same thing, regardless of the order of operands (linear algebra rules notwithstanding).
Parameters:
const Point3& V

The point to transform.

const Matrix3& A

The matrix to transform the point with.
Returns:
The transformed Point3.
GEOMEXPORT Point3 VectorTransform ( const Matrix3 M,
const Point3 V 
)
Remarks:
Transform the vector (Point3) with the specified matrix.
Parameters:
const Matrix3& A

The matrix to transform the vector with.

const Point3& V

The vector to transform.
Returns:
The transformed vector (as a Point3).
GEOMEXPORT Point3 VectorTransform ( const Point3 V,
const Matrix3 M 
)
GEOMEXPORT Point4 TransformPlane ( const Matrix3 M,
const Point4 plin 
)
GEOMEXPORT Matrix3 XFormMat ( const Matrix3 xm,
const Matrix3 m 
)
Remarks:
This method is used to build a matrix that constructs a transformation in a particular space. For example, say you have a rotation you want to apply, but you want to perform the rotation in another coordinate system. To do this, you typically transform into the space of the coordinate system, then apply the transformation, and then transform out of that coordinate system. This method constructs a matrix that does just this. It transformats matrix m so it is applied in the space of matrix xm. It returns a Matrix3 that is xm*m*Inverse(xm).
Parameters:
const Matrix3& xm

Specifies the coordinate system you want to work in.

const Matrix3& m

Specifies the transformation matrix.
Returns:
Returns a Matrix3 that is xm*m*Inverse(xm).