Public Member Functions | Private Attributes

lssr::Matrix4< ValueType > Class Template Reference

A 4x4 matrix class implementation for use with the provided vertex types. More...

#include <Matrix4.hpp>

List of all members.

Public Member Functions

 Matrix4 ()
 Default constructor. Initializes a identity matrix.
template<typename T >
 Matrix4 (T *matrix)
 Initializes a matrix wit the given data array. Ensure that the array has exactly 16 fields.
template<typename T >
 Matrix4 (const Matrix4< T > &other)
 Copy constructor.
template<typename T >
 Matrix4 (Vertex< T > axis, ValueType angle)
 Constructs a matrix from given axis and angle. Trya to avoid a gimbal lock.
template<typename T >
 Matrix4 (const Vertex< T > &position, const Vertex< T > &angles)
 Matrix4 (string filename)
virtual ~Matrix4 ()
template<typename T >
Matrix4 operator* (const T &scale) const
 Scales the matrix elemnts by the given factor.
template<typename T >
Matrix4 operator* (const Matrix4< T > &other) const
 Matrix-Matrix multiplication. Returns the new matrix.
template<typename T >
Matrix4 operator* (const T *&other) const
 Matrix-Matrix multiplication (array based). Mainly implemented for compatibility with other math libs. ensure that the used array has at least 16 elements to avoid memory access violations.
template<typename T >
Vertex< T > operator* (const Vertex< T > &v) const
 Multiplication of Matrix and Vertex types.
void set (int i, ValueType value)
 Sets the given index of the Matrix's data field to the provided value.
void transpose ()
 Transposes the current matrix.
void toPostionAngle (ValueType pose[6])
 Computes an Euler representation (x, y, z) plus three rotation values in rad. Rotations are with respect to the x, y, z axes.
void loadFromFile (string filename)
 Loads matrix values from a given file.
template<typename T >
void operator*= (const T scale)
 Matrix scaling with self assignment.
template<typename T >
void operator*= (const Matrix4< T > &other)
 Matrix-Matrix multiplication with self assigment.
template<typename T >
void operator*= (const T *other)
 Matrix-Matrix multiplication (array based). See operator*}.
ValueType * getData ()
 Returns the internal data array. Unsafe. Will probably removed in one of the next versions.
ValueType at (const int i) const
 Returns the element at the given index.
ValueType operator[] (const int index) const
 Indexed element access.

Private Attributes

ValueType m [16]

Detailed Description

template<typename ValueType>
class lssr::Matrix4< ValueType >

A 4x4 matrix class implementation for use with the provided vertex types.

Definition at line 30 of file Matrix4.hpp.


Constructor & Destructor Documentation

template<typename ValueType>
lssr::Matrix4< ValueType >::Matrix4 (  )  [inline]

Default constructor. Initializes a identity matrix.

Definition at line 36 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
lssr::Matrix4< ValueType >::Matrix4 ( T *  matrix  )  [inline]

Initializes a matrix wit the given data array. Ensure that the array has exactly 16 fields.

Definition at line 47 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
lssr::Matrix4< ValueType >::Matrix4 ( const Matrix4< T > &  other  )  [inline]

Copy constructor.

Definition at line 56 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
lssr::Matrix4< ValueType >::Matrix4 ( Vertex< T >  axis,
ValueType  angle 
) [inline]

Constructs a matrix from given axis and angle. Trya to avoid a gimbal lock.

Definition at line 66 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
lssr::Matrix4< ValueType >::Matrix4 ( const Vertex< T > &  position,
const Vertex< T > &  angles 
) [inline]

Definition at line 140 of file Matrix4.hpp.

template<typename ValueType>
lssr::Matrix4< ValueType >::Matrix4 ( string  filename  ) 
template<typename ValueType>
virtual lssr::Matrix4< ValueType >::~Matrix4 (  )  [inline, virtual]

Definition at line 171 of file Matrix4.hpp.


Member Function Documentation

template<typename ValueType>
ValueType lssr::Matrix4< ValueType >::at ( const int  i  )  const

Returns the element at the given index.

template<typename ValueType>
ValueType* lssr::Matrix4< ValueType >::getData (  )  [inline]

Returns the internal data array. Unsafe. Will probably removed in one of the next versions.

Definition at line 379 of file Matrix4.hpp.

template<typename ValueType>
void lssr::Matrix4< ValueType >::loadFromFile ( string  filename  )  [inline]

Loads matrix values from a given file.

Definition at line 336 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
Matrix4 lssr::Matrix4< ValueType >::operator* ( const T &  scale  )  const [inline]

Scales the matrix elemnts by the given factor.

Definition at line 180 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
Matrix4 lssr::Matrix4< ValueType >::operator* ( const Matrix4< T > &  other  )  const [inline]

Matrix-Matrix multiplication. Returns the new matrix.

Definition at line 194 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
Vertex<T> lssr::Matrix4< ValueType >::operator* ( const Vertex< T > &  v  )  const [inline]

Multiplication of Matrix and Vertex types.

Definition at line 249 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
Matrix4 lssr::Matrix4< ValueType >::operator* ( const T *&  other  )  const [inline]

Matrix-Matrix multiplication (array based). Mainly implemented for compatibility with other math libs. ensure that the used array has at least 16 elements to avoid memory access violations.

Definition at line 223 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
void lssr::Matrix4< ValueType >::operator*= ( const T *  other  )  [inline]

Matrix-Matrix multiplication (array based). See operator*}.

Definition at line 370 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
void lssr::Matrix4< ValueType >::operator*= ( const T  scale  )  [inline]

Matrix scaling with self assignment.

Definition at line 352 of file Matrix4.hpp.

template<typename ValueType>
template<typename T >
void lssr::Matrix4< ValueType >::operator*= ( const Matrix4< T > &  other  )  [inline]

Matrix-Matrix multiplication with self assigment.

Definition at line 361 of file Matrix4.hpp.

template<typename ValueType>
ValueType lssr::Matrix4< ValueType >::operator[] ( const int  index  )  const [inline]

Indexed element access.

TODO: Boundary check

Definition at line 389 of file Matrix4.hpp.

template<typename ValueType>
void lssr::Matrix4< ValueType >::set ( int  i,
ValueType  value 
) [inline]

Sets the given index of the Matrix's data field to the provided value.

Parameters:
i Field index of the matrix
value new value

Definition at line 269 of file Matrix4.hpp.

template<typename ValueType>
void lssr::Matrix4< ValueType >::toPostionAngle ( ValueType  pose[6]  )  [inline]

Computes an Euler representation (x, y, z) plus three rotation values in rad. Rotations are with respect to the x, y, z axes.

Definition at line 301 of file Matrix4.hpp.

template<typename ValueType>
void lssr::Matrix4< ValueType >::transpose (  )  [inline]

Transposes the current matrix.

Definition at line 274 of file Matrix4.hpp.


Member Data Documentation

template<typename ValueType>
ValueType lssr::Matrix4< ValueType >::m[16] [private]

Definition at line 396 of file Matrix4.hpp.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Defines