RTFX  0.3
Real time special effects collaborative visualization and production library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
RTFX::Matrix4x4 Class Reference

A homogeneous transformation matrix. More...

#include <algebra.hpp>

Public Member Functions

 Matrix4x4 ()
 
 Matrix4x4 (double _a0, double _a1, double _a2, double _b0, double _b1, double _b2, double _c0, double _c1, double _c2)
 
 Matrix4x4 (const Matrix4x4 &_other)
 
 Matrix4x4 (const Vector4D _row1, const Vector4D _row2, const Vector4D _row3, const Vector4D _row4)
 
 Matrix4x4 (double *_vals)
 
Matrix4x4operator= (const Matrix4x4 &_other)
 
Vector4D getRow (size_t _row) const
 
double * getRow (size_t _row)
 
Vector4D getColumn (size_t _col) const
 
Vector4D operator[] (size_t _row) const
 
double * operator[] (size_t _row)
 
Matrix4x4 transpose () const
 
Matrix4x4 invert () const
 
double det ()
 
const double * begin () const
 
const double * end () const
 
double * data ()
 
bool operator== (Matrix4x4 &_o)
 

Private Member Functions

template<class Archive >
void serialize (Archive &_ar, const unsigned int _version)
 

Private Attributes

double v [16]
 

Friends

class boost::serialization::access
 

Detailed Description

A homogeneous transformation matrix.

This matrix has 4 rows and 4 columns for a total of 16 elements. The matrix is of the Matlab form [ A B C dX; D E F dY; G H I dZ; 0 0 0 1 ];

Constructor & Destructor Documentation

RTFX::Matrix4x4::Matrix4x4 ( )
inline

The base constructor, sets the matrix to the identity matrix

RTFX::Matrix4x4::Matrix4x4 ( double  _a0,
double  _a1,
double  _a2,
double  _b0,
double  _b1,
double  _b2,
double  _c0,
double  _c1,
double  _c2 
)
inline

Construct a Matrix4x4 using 9 input values which correspond to the non-translational rows of the matrix.

RTFX::Matrix4x4::Matrix4x4 ( const Matrix4x4 _other)
inline

Copy constructor

RTFX::Matrix4x4::Matrix4x4 ( const Vector4D  _row1,
const Vector4D  _row2,
const Vector4D  _row3,
const Vector4D  _row4 
)
inline

Construct a Matrix4x4 from four Vector4D's which represent the rows of the matrix

RTFX::Matrix4x4::Matrix4x4 ( double *  _vals)
inline

Create a Matrix4x4 from an array of double values. Assumption: the input array has 16 elements

Member Function Documentation

const double* RTFX::Matrix4x4::begin ( ) const
inline

Get a pointer to the beginning of the data

double* RTFX::Matrix4x4::data ( )
inline

Get a pointer to the data

double RTFX::Matrix4x4::det ( )

Compute and return the determinant of this Matrix4x4

Compute the determinant: NOT IMPLEMENTED, THIS FUNCTION ALWAYS RETURNS 1

const double* RTFX::Matrix4x4::end ( ) const
inline

Get a pointer to the end of the data

Vector4D RTFX::Matrix4x4::getColumn ( size_t  _col) const
inline

Return a Vector4D corresponding to the column requested. Assumption: the column value is between 0 and 3

Vector4D RTFX::Matrix4x4::getRow ( size_t  _row) const
inline

Return a Vector4D corresponding to the row requested. Assumption: the row value is between 0 and 3

double* RTFX::Matrix4x4::getRow ( size_t  _row)
inline

Return a double array corresponding to the row requested. Assumption: the row value is between 0 and 3

Matrix4x4 RTFX::Matrix4x4::invert ( ) const

Return a new Matrix4x4 which is the inversion of this one

invertMatrix

I lifted this code from the skeleton code of a raytracer assignment from a different school. I taught that course too, so I figured it would be okay.

References RTFX::dividerow(), RTFX::submultrow(), and RTFX::swaprows().

Matrix4x4& RTFX::Matrix4x4::operator= ( const Matrix4x4 _other)
inline

Equals operator, sets this matrix to equal another

bool RTFX::Matrix4x4::operator== ( Matrix4x4 _o)
inline

Determine if this Matrix4x4 equals the input one

References data().

Vector4D RTFX::Matrix4x4::operator[] ( size_t  _row) const
inline

Get a row of the matrix using the array [] operator as a Vector4D. Assumption: the row specified is between 0 and 3

double* RTFX::Matrix4x4::operator[] ( size_t  _row)
inline

Get a row of the matrix using the array [] operator as a double array. Assumption: the row specified is between 0 and 3

Matrix4x4 RTFX::Matrix4x4::transpose ( ) const
inline

Return a new Matrix4x4 which is the transpose of this one


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