ork::mat3< type > Class Template Reference
[math]

A 3x3 matrix. More...

#include <mat3.h>

List of all members.

Public Member Functions

 mat3 ()
 Creates a new, uninitialized matrix.
 mat3 (type m00, type m01, type m02, type m10, type m11, type m12, type m20, type m21, type m22)
 Creates a new matrix with the given components.
 mat3 (const type *array)
 Creates a new matrix with the given components in row major order.
 mat3 (const type array[3][3])
 Creates a new matrix with the given components.
 mat3 (const mat3 &mat)
 Creates a new matrix as a copy of the given matrix.
const type * coefficients () const
 Returns the coefficients of this matrix.
type * operator[] (int iRow) const
 Returns the row of this matrix whose index is given.
vec3< type > getColumn (int iCol) const
 Returns the column of this matrix whose index is given.
void setColumn (int iCol, const vec3< type > &v)
 Sets the column of this matrix whose index is given.
void fromAxes (const vec3< type > &xAxis, const vec3< type > &yAxis, const vec3< type > &zAxis)
 Sets the columns of this matrix from the 3 given column vectors.
mat3operator= (const mat3 &mat)
 Assigns the given matrix to this matrix.
bool operator== (const mat3 &mat) const
 Returns true is this matrix is equal to the given matrix.
bool operator!= (const mat3 &mat) const
 Returns true is this matrix is different from the given matrix.
mat3 operator+ (const mat3 &mat) const
 Returns the sum of this matrix and of the given matrix.
mat3 operator- (const mat3 &mat) const
 Returns the difference of this matrix and of the given matrix.
mat3 operator* (const mat3 &mat) const
 Returns the product of this matrix and of the given matrix.
vec3< type > operator* (const vec3< type > &v) const
 Returns the product of this matrix and of the given vector.
vec2< type > operator* (const vec2< type > &v) const
 Returns the product of this matrix and of the given vector.
box3< type > operator* (const box3< type > &b) const
 Returns the bounding box of the given bounding box, transformed by the linear transformation represented by this matrix.
mat3 operator* (const type scalar) const
 Returns the product of this matrix and of the given scalar.
mat3 operator- () const
 Returns the opposite of this matrix.
mat3 transpose () const
 Returns the transpose of this matrix.
bool inverse (mat3 &mInv, type tolerance=1e-06) const
 Returns true is this matrix has an inverse.
mat3 inverse (type tolerance=1e-06) const
 Returns the inverse of this matrix.
type determinant () const
 Returns the determinant of this matrix.
type trace () const
 Returns the trace of this matrix.
template<class t >
mat3< t > cast () const
 Casts this matrix to another base type.

Static Public Attributes

static const mat3 ZERO
 The null matrix.
static const mat3 IDENTITY
 The identity matrix.

Protected Attributes

union {
   type   m [3][3]
 The matrix coefficients as a 2D array.
   type   _m [9]
 The matrix coefficients as a 1D array.
}; 
 The matrix coeffients.

Detailed Description

template<typename type>
class ork::mat3< type >

A 3x3 matrix.


Constructor & Destructor Documentation

template<typename type >
ork::mat3< type >::mat3 (  )  [inline]

Creates a new, uninitialized matrix.

template<typename type >
ork::mat3< type >::mat3 ( type  m00,
type  m01,
type  m02,
type  m10,
type  m11,
type  m12,
type  m20,
type  m21,
type  m22 
) [inline]

Creates a new matrix with the given components.

The first index is the row index, the second one is the column index.

template<typename type >
ork::mat3< type >::mat3 ( const type *  array  )  [inline]

Creates a new matrix with the given components in row major order.

template<typename type >
ork::mat3< type >::mat3 ( const type  array[3][3]  )  [inline, explicit]

Creates a new matrix with the given components.

The first index is the row index, the second one is the column index.

template<typename type >
ork::mat3< type >::mat3 ( const mat3< type > &  mat  )  [inline]

Creates a new matrix as a copy of the given matrix.


Member Function Documentation

template<typename type >
template<class t >
mat3<t> ork::mat3< type >::cast (  )  const [inline]

Casts this matrix to another base type.

template<typename type >
const type * ork::mat3< type >::coefficients (  )  const [inline]

Returns the coefficients of this matrix.

template<typename type >
type ork::mat3< type >::determinant (  )  const [inline]

Returns the determinant of this matrix.

template<typename type >
void ork::mat3< type >::fromAxes ( const vec3< type > &  xAxis,
const vec3< type > &  yAxis,
const vec3< type > &  zAxis 
) [inline]

Sets the columns of this matrix from the 3 given column vectors.

template<typename type >
vec3< type > ork::mat3< type >::getColumn ( int  iCol  )  const [inline]

Returns the column of this matrix whose index is given.

template<typename type >
mat3< type > ork::mat3< type >::inverse ( type  tolerance = 1e-06  )  const [inline]

Returns the inverse of this matrix.

template<typename type >
bool ork::mat3< type >::inverse ( mat3< type > &  mInv,
type  tolerance = 1e-06 
) const [inline]

Returns true is this matrix has an inverse.

In this case the inverse matrix is returned in the given matrix parameter.

template<typename type >
bool ork::mat3< type >::operator!= ( const mat3< type > &  mat  )  const [inline]

Returns true is this matrix is different from the given matrix.

template<typename type >
mat3< type > ork::mat3< type >::operator* ( const type  scalar  )  const [inline]

Returns the product of this matrix and of the given scalar.

template<typename type >
box3< type > ork::mat3< type >::operator* ( const box3< type > &  b  )  const [inline]

Returns the bounding box of the given bounding box, transformed by the linear transformation represented by this matrix.

template<typename type >
vec2< type > ork::mat3< type >::operator* ( const vec2< type > &  v  )  const [inline]

Returns the product of this matrix and of the given vector.

The given vector z coordinate is set to 1, and the vec3 result is converted to a vec2 by dividing its xy components by its z component.

template<typename type >
vec3< type > ork::mat3< type >::operator* ( const vec3< type > &  v  )  const [inline]

Returns the product of this matrix and of the given vector.

template<typename type >
mat3< type > ork::mat3< type >::operator* ( const mat3< type > &  mat  )  const [inline]

Returns the product of this matrix and of the given matrix.

template<typename type >
mat3< type > ork::mat3< type >::operator+ ( const mat3< type > &  mat  )  const [inline]

Returns the sum of this matrix and of the given matrix.

template<typename type >
mat3< type > ork::mat3< type >::operator- (  )  const [inline]

Returns the opposite of this matrix.

template<typename type >
mat3< type > ork::mat3< type >::operator- ( const mat3< type > &  mat  )  const [inline]

Returns the difference of this matrix and of the given matrix.

template<typename type >
mat3< type > & ork::mat3< type >::operator= ( const mat3< type > &  mat  )  [inline]

Assigns the given matrix to this matrix.

template<typename type >
bool ork::mat3< type >::operator== ( const mat3< type > &  mat  )  const [inline]

Returns true is this matrix is equal to the given matrix.

template<typename type >
type * ork::mat3< type >::operator[] ( int  iRow  )  const [inline]

Returns the row of this matrix whose index is given.

template<typename type >
void ork::mat3< type >::setColumn ( int  iCol,
const vec3< type > &  v 
) [inline]

Sets the column of this matrix whose index is given.

template<typename type >
type ork::mat3< type >::trace (  )  const [inline]

Returns the trace of this matrix.

template<typename type >
mat3< type > ork::mat3< type >::transpose (  )  const [inline]

Returns the transpose of this matrix.


Member Data Documentation

union { ... } [protected]

The matrix coeffients.

template<typename type >
type ork::mat3< type >::_m[9]

The matrix coefficients as a 1D array.

template<typename type >
const mat3< type > ork::mat3< type >::IDENTITY [inline, static]

The identity matrix.

template<typename type >
type ork::mat3< type >::m[3][3]

The matrix coefficients as a 2D array.

template<typename type >
const mat3< type > ork::mat3< type >::ZERO [inline, static]

The null matrix.


Generated on Mon Oct 18 09:36:08 2010 for ork by  doxygen 1.6.1