Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

RayGina::CORE::RMatrix4x4< T > Class Template Reference

4x4 matrix class with variable type. More...

#include <RMatrix4x4.hxx>

Inheritance diagram for RayGina::CORE::RMatrix4x4< T >:

RayGina::CORE::RMatrix< T, 4, 4 > List of all members.

Public Member Functions

 RMatrix4x4 ()
 RMatrix4x4 (T value)
 RMatrix4x4 (const T *data)
template<typename R>
 RMatrix4x4 (const RMatrix4x4< R > &other)
T & operator() (std::size_t row, std::size_t col)
const T & operator() (std::size_t row, std::size_t col) const
RMatrix4x4< T > & operator+= (const RMatrix4x4< T > &M)
RMatrix4x4< T > & operator-= (const RMatrix4x4< T > &M)
RMatrix4x4< T > & operator *= (const RMatrix4x4< T > &M)
RMatrix4x4< T > & operator *= (T s)
void multiply (const RMatrix4x4< T > &M)
void preMultiply (const RMatrix4x4< T > &M)
void invert ()
trace (void) const

Static Public Member Functions

RMatrix4x4< T > createRotationMatrix (T angle, const RVec3< T > &direction, const RVec3< T > &origin)
RMatrix4x4< T > createRotationMatrix (T angle, typename RVec3< T >::AXIS axis)
RMatrix4x4< T > createTranslationMatrix (const RVec3< T > &translation)
RMatrix4x4< T > createScaleMatrix (const RVec3< T > &scale)
const RMatrix4x4< T > & identity ()
const RMatrix4x4< T > & zero ()

Static Private Member Functions

const RMatrix4x4< T > _createIdentity ()
const RMatrix4x4< T > _createZero ()

Static Private Attributes

const RMatrix4x4< T > _identity = RMatrix4x4<T>::_createIdentity()
const RMatrix4x4< T > _zero = RMatrix4x4<T>::_createZero()

Friends

RMatrix4x4< T > operator+ (const RMatrix4x4< T > &A, const RMatrix4x4< T > &B)
RMatrix4x4< T > operator- (const RMatrix4x4< T > &A, const RMatrix4x4< T > &B)
RMatrix4x4< T > operator * (const RMatrix4x4< T > &A, const RMatrix4x4< T > &B)
RMatrix4x4< T > operator * (T s, const RMatrix4x4< T > &M)

Detailed Description

template<typename T>
class RayGina::CORE::RMatrix4x4< T >

4x4 matrix class with variable type.

Uses T as type for its elements.

Author:
Stephan Weigelt (pushmatrix), Thomas Rokohl (vice)
Warning:
TODO the factory methods for transformations

Definition at line 69 of file RMatrix4x4.hxx.


Constructor & Destructor Documentation

template<typename T>
RayGina::CORE::RMatrix4x4< T >::RMatrix4x4  )  [inline]
 

Default constructor. Assign the default value T() to all elements (== 0 for basic types).

Definition at line 43 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T >::RMatrix4x4 value  )  [inline, explicit]
 

Initalizes all elements with the given value.

Parameters:
value the value to assign. Note: Explicit usage only to prevent assigning a value with '='-Operator.

Definition at line 52 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T >::RMatrix4x4 const T *  data  )  [inline, explicit]
 

Copies the data from data (16 values). Assumes row-wise ordering, e.g. {1,0,0,0, 0,1,0,0, ... } for the identity.

Definition at line 61 of file RMatrix4x4.inl.

template<typename T>
template<typename R>
RayGina::CORE::RMatrix4x4< T >::RMatrix4x4 const RMatrix4x4< R > &  other  )  [inline]
 

Template-Constructor. Does not hide the (default-)copy-constructor !

Definition at line 71 of file RMatrix4x4.inl.


Member Function Documentation

template<typename T>
const RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::_createIdentity  )  [static, private]
 

Helper function to create the static const Identity

Definition at line 7 of file RMatrix4x4.inl.

template<typename T>
const RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::_createZero  )  [static, private]
 

Helper function to create the static const Zero

Definition at line 15 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::createRotationMatrix angle,
typename RVec3< T >::AXIS  axis
[static]
 

Creates a rotation matrix.

Parameters:
axis the axis of rotation
the angle (radian)
Returns:
the matrix

Definition at line 356 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::createRotationMatrix angle,
const RVec3< T > &  direction,
const RVec3< T > &  origin
[static]
 

Creates a matrix for rotation about an arbitrary axis.

Parameters:
origin the origin of the rotation-axis
direction the direction of the rotation-axis
the angle (radian)
Returns:
the matrix

Definition at line 316 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::createScaleMatrix const RVec3< T > &  scale  )  [static]
 

Creates a scale matrix.

Parameters:
scale the scale vector (note: the forth's element is ignored !)
Returns:
the matrix

Definition at line 293 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::createTranslationMatrix const RVec3< T > &  translation  )  [static]
 

Creates a translation matrix.

Parameters:
translation the translation vector (note: the forth's element is ignored !)
Returns:
the matrix

Definition at line 304 of file RMatrix4x4.inl.

template<typename T>
const RayGina::CORE::RMatrix4x4< T > & RayGina::CORE::RMatrix4x4< T >::identity  )  [static]
 

Identity-matrix.

Definition at line 37 of file RMatrix4x4.inl.

template<typename T>
void RayGina::CORE::RMatrix4x4< T >::invert  )  [inline]
 

Inverts this matrix.

Warning:
this is not possible in general !

this should be reviewed and optimized for the internal structure of this class

Definition at line 164 of file RMatrix4x4.inl.

template<typename T>
void RayGina::CORE::RMatrix4x4< T >::multiply const RMatrix4x4< T > &  M  )  [inline]
 

Post-multiplies the other matrix to this matrix, so this = this*M

Definition at line 144 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > & RayGina::CORE::RMatrix4x4< T >::operator *= s  )  [inline]
 

Scalar Multiplication s*(this)

Returns:
reference to itself

Definition at line 131 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > & RayGina::CORE::RMatrix4x4< T >::operator *= const RMatrix4x4< T > &  M  )  [inline]
 

(Post-)Multiplication

Returns:
reference to itself
See also:
multiply()

Definition at line 108 of file RMatrix4x4.inl.

template<typename T>
const T & RayGina::CORE::RMatrix4x4< T >::operator() std::size_t  row,
std::size_t  col
const [inline]
 

Reference to a value (const, so only reading is possible).

Returns:
the value as a const reference.

Reimplemented from RayGina::CORE::RMatrix< T, 4, 4 >.

Definition at line 282 of file RMatrix4x4.inl.

template<typename T>
T & RayGina::CORE::RMatrix4x4< T >::operator() std::size_t  row,
std::size_t  col
[inline]
 

Reference to a value (not const, so reading and writing is possible).

Returns:
the value as a reference.

Reimplemented from RayGina::CORE::RMatrix< T, 4, 4 >.

Definition at line 270 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > & RayGina::CORE::RMatrix4x4< T >::operator+= const RMatrix4x4< T > &  M  )  [inline]
 

Element-wise addition

Returns:
reference to itself

Definition at line 82 of file RMatrix4x4.inl.

template<typename T>
RayGina::CORE::RMatrix4x4< T > & RayGina::CORE::RMatrix4x4< T >::operator-= const RMatrix4x4< T > &  M  )  [inline]
 

Element-wise subtraction

Returns:
reference to itself

Definition at line 95 of file RMatrix4x4.inl.

template<typename T>
void RayGina::CORE::RMatrix4x4< T >::preMultiply const RMatrix4x4< T > &  M  )  [inline]
 

Pre-multiplies the other matrix, so this = M*this

Definition at line 153 of file RMatrix4x4.inl.

template<typename T>
T RayGina::CORE::RMatrix4x4< T >::trace void   )  const [inline]
 

Returns:
the trace of this matrix

Definition at line 257 of file RMatrix4x4.inl.

template<typename T>
const RayGina::CORE::RMatrix4x4< T > & RayGina::CORE::RMatrix4x4< T >::zero  )  [static]
 

Zero-matrix.

Reimplemented from RayGina::CORE::RMatrix< T, 4, 4 >.

Definition at line 30 of file RMatrix4x4.inl.


Friends And Related Function Documentation

template<typename T>
RMatrix4x4<T> operator * s,
const RMatrix4x4< T > &  M
[friend]
 

Scalar multiplication

Returns:
s*A (element-wise)

template<typename T>
RMatrix4x4<T> operator * const RMatrix4x4< T > &  A,
const RMatrix4x4< T > &  B
[friend]
 

Returns:
A*B

template<typename T>
RMatrix4x4<T> operator+ const RMatrix4x4< T > &  A,
const RMatrix4x4< T > &  B
[friend]
 

Returns:
A+B (element-wise)

template<typename T>
RMatrix4x4<T> operator- const RMatrix4x4< T > &  A,
const RMatrix4x4< T > &  B
[friend]
 

Returns:
A-B (element-wise)


Member Data Documentation

template<typename T>
const RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::_identity = RMatrix4x4<T>::_createIdentity() [static, private]
 

Definition at line 22 of file RMatrix4x4.inl.

template<typename T>
const RayGina::CORE::RMatrix4x4< T > RayGina::CORE::RMatrix4x4< T >::_zero = RMatrix4x4<T>::_createZero() [static, private]
 

Definition at line 26 of file RMatrix4x4.inl.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 17:01:09 2007 for rayGina by  doxygen 1.3.9.1