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

A 4x4 matrix. More...

#include <mat4.h>

List of all members.

Public Member Functions

 mat4 ()
 Creates a new, uninitialized matrix.
 mat4 (type m00, type m01, type m02, type m03, type m10, type m11, type m12, type m13, type m20, type m21, type m22, type m23, type m30, type m31, type m32, type m33)
 Creates a new matrix with the given components.
 mat4 (const type *array)
 Creates a new matrix with the given components in row major order.
 mat4 (const type array[4][4])
 Creates a new matrix with the given components.
 mat4 (const mat3< type > &m3x3)
 Creates a new matrix as a copy of the given matrix.
const type * coefficients () const
 Returns the coefficients of this matrix.
const type * operator[] (int iRow) const
 Returns the row of this matrix whose index is given.
void operator= (const mat3< type > &m3)
 Assigns the given matrix to this matrix.
bool operator== (const mat4 &m2) const
 Returns true is this matrix is equal to the given matrix.
bool operator!= (const mat4 &m2) const
 Returns true is this matrix is different from the given matrix.
mat4 operator+ (const mat4 &m2) const
 Returns the sum of this matrix and of the given matrix.
mat4 operator- (const mat4 &m2) const
 Returns the difference of this matrix and of the given matrix.
mat4 operator* (const mat4 &m2) const
 Returns the product of this matrix and of the given matrix.
vec4< type > operator* (const vec4< type > &v) const
 Returns the product of this matrix and of the given vector.
vec3< type > operator* (const vec3< 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, transormed by the linear transformation represented by this matrix.
mat4 operator* (type f) const
 Returns the product of this matrix and of the given scalar.
mat4 transpose (void) const
 Returns the transpose of this matrix.
mat4 adjoint () const
 Returns the adjoint of this matrix.
mat4 inverse () const
 Returns the inverse of this matrix.
mat3< type > mat3x3 () const
 Returns the linear part of this matrix (i.e.
type determinant () const
 Returns the determinant of this matrix.
template<class t >
mat4< t > cast () const
 Casts this matrix to another base type.

Static Public Member Functions

static mat4 translate (const vec3< type > &v)
 Returns the translation matrix corresponding to the given translation vector.
static mat4 rotatex (type angle)
 Returns the rotation matrix corresponding to the rotation around the x axis with the given angle.
static mat4 rotatey (type angle)
 Returns the rotation matrix corresponding to the rotation around the y axis with the given angle.
static mat4 rotatez (type angle)
 Returns the rotation matrix corresponding to the rotation around the z axis with the given angle.
static mat4 perspectiveProjection (type fovy, type aspect, type zNear, type zFar)
 Returns the perspective projection matrix corresponding to the given projection parameters.
static mat4 orthoProjection (type xRight, type xLeft, type yTop, type yBottom, type zNear, type zFar)
 Returns the orthographic projection matrix corresponding to the given projection parameters.

Static Public Attributes

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

Protected Attributes

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

Detailed Description

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

A 4x4 matrix.


Constructor & Destructor Documentation

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

Creates a new, uninitialized matrix.

template<typename type>
ork::mat4< type >::mat4 ( type  m00,
type  m01,
type  m02,
type  m03,
type  m10,
type  m11,
type  m12,
type  m13,
type  m20,
type  m21,
type  m22,
type  m23,
type  m30,
type  m31,
type  m32,
type  m33 
) [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::mat4< type >::mat4 ( const type *  array  )  [inline]

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

template<typename type>
ork::mat4< type >::mat4 ( const type  array[4][4]  )  [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::mat4< type >::mat4 ( const mat3< type > &  m3x3  )  [inline]

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

The missing components are initialized to 0 (except the w,w component, initialized to 1).


Member Function Documentation

template<typename type >
mat4< type > ork::mat4< type >::adjoint (  )  const [inline]

Returns the adjoint of this matrix.

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

Casts this matrix to another base type.

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

Returns the coefficients of this matrix.

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

Returns the determinant of this matrix.

template<typename type >
mat4< type > ork::mat4< type >::inverse (  )  const [inline]

Returns the inverse of this matrix.

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

Returns the linear part of this matrix (i.e.

without translations).

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

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

template<typename type>
mat4< type > ork::mat4< type >::operator* ( type  f  )  const [inline]

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

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

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

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

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

The given vector w coordinate is set to 1, and the 4 vector result is converted to a 3 vector by dividing its xyz components by its w component.

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

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

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

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

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

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

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

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

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

Assigns the given matrix to this matrix.

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

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

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

Returns the row of this matrix whose index is given.

template<typename type>
mat4< type > ork::mat4< type >::orthoProjection ( type  xRight,
type  xLeft,
type  yTop,
type  yBottom,
type  zNear,
type  zFar 
) [inline, static]

Returns the orthographic projection matrix corresponding to the given projection parameters.

Parameters:
xRight right clipping plane.
xLeft left clipping plane.
yTop top clipping plane.
yBottom bottom clipping plane.
zNear near clipping plane.
zFar far clipping plane.
template<typename type>
mat4< type > ork::mat4< type >::perspectiveProjection ( type  fovy,
type  aspect,
type  zNear,
type  zFar 
) [inline, static]

Returns the perspective projection matrix corresponding to the given projection parameters.

Parameters:
fovy vertical field of view in degrees.
aspect aspect ratio of the projection window.
zNear near clipping plane.
zFar far clipping plane.
template<typename type>
mat4< type > ork::mat4< type >::rotatex ( type  angle  )  [inline, static]

Returns the rotation matrix corresponding to the rotation around the x axis with the given angle.

Parameters:
angle rotation angle in degrees.
template<typename type>
mat4< type > ork::mat4< type >::rotatey ( type  angle  )  [inline, static]

Returns the rotation matrix corresponding to the rotation around the y axis with the given angle.

Parameters:
angle rotation angle in degrees.
template<typename type>
mat4< type > ork::mat4< type >::rotatez ( type  angle  )  [inline, static]

Returns the rotation matrix corresponding to the rotation around the z axis with the given angle.

Parameters:
angle rotation angle in degrees.
template<typename type>
mat4< type > ork::mat4< type >::translate ( const vec3< type > &  v  )  [inline, static]

Returns the translation matrix corresponding to the given translation vector.

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

Returns the transpose of this matrix.


Member Data Documentation

union { ... } [protected]

The matrix coeffients.

template<typename type>
type ork::mat4< type >::_m[16]

The matrix coefficients as a 1D array.

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

The identity matrix.

template<typename type>
type ork::mat4< type >::m[4][4]

The matrix coefficients as a 2D array.

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

The null matrix.


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