Rasterfarm-SDK
Loading...
Searching...
No Matches
Matrix< T, ROWS, COLS > Class Template Reference

#include <matrix.h>

Public Member Functions

Toperator[] (const uint index)
 
const Toperator[] (const uint index) const
 
 Matrix ()
 
 Matrix (T array[])
 
template<typename... ARGS>
 Matrix (ARGS...argList)
 
template<typename U >
 Matrix (const Matrix< U, ROWS, COLS > &other)
 
 Matrix (const Matrix< T, ROWS+1, COLS+1 > &other)
 
 Matrix (const Matrix< T, ROWS - 1, COLS - 1 > &other)
 
 Matrix (const Matrix< T, ROWS, COLS > &other)
 
void operator= (const Matrix< T, ROWS, COLS > &other)
 
void operator= (const Matrix< T, ROWS+1, COLS+1 > &other)
 
void operator= (const Matrix< T, ROWS - 1, COLS - 1 > &other)
 
const bool operator== (const Matrix< T, ROWS, COLS > &other) const
 
const bool operator!= (const Matrix< T, ROWS, COLS > &other) const
 
uint rows () const
 
uint cols () const
 
bool isSquare () const
 
void clear ()
 
void print () const
 
void loadIdentity ()
 
const Vector< T, ROWS > getDiagonal () const
 
const Vector< T, ROWS > getRow (uint row) const
 
void setRow (uint row, const Vector< T, ROWS > &v)
 
const Vector< T, COLS > getCol (uint col) const
 
void setCol (uint col, const Vector< T, COLS > &v)
 
template<uint LENGTH>
const Vector< T, LENGTH > getScale () const
 
template<uint LENGTH>
void normalize ()
 
template<uint LENGTH>
const Matrix< T, LENGTH, LENGTH > normal () const
 
template<uint LENGTH>
void scale (T scale)
 
template<uint LENGTH>
void scale (const Vector< T, LENGTH > &vec)
 
template<uint LENGTH>
void scaleTo (const Vector< T, LENGTH > &vec)
 
const Matrix< T, ROWS, COLS > rotation (T angle, const Vector< T, 3 > &vec) const
 
void rotate (T angle, const Vector< T, 3 > &vec)
 
const Matrix< T, ROWS, COLS > translation (const Vector< T, 3 > &vec) const
 
void translate (const Vector< T, 3 > &vec)
 
Matrix< T, ROWS, COLS > & transpose ()
 
Matrix< T, ROWS, COLS > & invert ()
 
void transform (const Matrix< T, ROWS, COLS > &src)
 
void set (const Matrix< T, ROWS, COLS > &src)
 

Static Public Member Functions

static const Matrix< T, ROWS, COLS > createIdentityMatrix ()
 
static const Quaternion< TmatrixTo (const Matrix< T, 3, 3 > &mat)
 
static const Matrix< T, 3, 3 > toMatrix (const Quaternion< T > &q)
 
static const Matrix< T, 4, 4 > createTranslationMatrix (const Vector< T, 3 > &vec)
 
static const Matrix< T, 3, 3 > createRotationMatrix (T angle, const Vector< T, 3 > &vec)
 

Public Attributes

T m [ROWS][COLS]
 

Static Public Attributes

static const Matrix< T, ROWS, COLS > identity = Matrix< T, ROWS, COLS >::createIdentityMatrix()
 

Constructor & Destructor Documentation

◆ Matrix() [1/7]

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS >::Matrix ( )
inline

◆ Matrix() [2/7]

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS >::Matrix ( T array[])
inline

◆ Matrix() [3/7]

template<typename T , uint ROWS, uint COLS>
template<typename... ARGS>
Matrix< T, ROWS, COLS >::Matrix ( ARGS... argList)
inline

◆ Matrix() [4/7]

template<typename T , uint ROWS, uint COLS>
template<typename U >
Matrix< T, ROWS, COLS >::Matrix ( const Matrix< U, ROWS, COLS > & other)
inline

◆ Matrix() [5/7]

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS >::Matrix ( const Matrix< T, ROWS+1, COLS+1 > & other)
inline

◆ Matrix() [6/7]

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS >::Matrix ( const Matrix< T, ROWS - 1, COLS - 1 > & other)
inline

◆ Matrix() [7/7]

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS >::Matrix ( const Matrix< T, ROWS, COLS > & other)
inline

Member Function Documentation

◆ clear()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::clear ( )
inline

◆ cols()

template<typename T , uint ROWS, uint COLS>
uint Matrix< T, ROWS, COLS >::cols ( ) const
inline

◆ createIdentityMatrix()

template<typename T , uint ROWS, uint COLS>
static const Matrix< T, ROWS, COLS > Matrix< T, ROWS, COLS >::createIdentityMatrix ( )
inlinestatic

◆ createRotationMatrix()

template<typename T , uint ROWS, uint COLS>
static const Matrix< T, 3, 3 > Matrix< T, ROWS, COLS >::createRotationMatrix ( T angle,
const Vector< T, 3 > & vec )
inlinestatic
Parameters
Theangle to rotate about the vector
Thevector must be unit-length 1(normalized)

◆ createTranslationMatrix()

template<typename T , uint ROWS, uint COLS>
static const Matrix< T, 4, 4 > Matrix< T, ROWS, COLS >::createTranslationMatrix ( const Vector< T, 3 > & vec)
inlinestatic

◆ getCol()

template<typename T , uint ROWS, uint COLS>
const Vector< T, COLS > Matrix< T, ROWS, COLS >::getCol ( uint col) const
inline

◆ getDiagonal()

template<typename T , uint ROWS, uint COLS>
const Vector< T, ROWS > Matrix< T, ROWS, COLS >::getDiagonal ( ) const
inline

◆ getRow()

template<typename T , uint ROWS, uint COLS>
const Vector< T, ROWS > Matrix< T, ROWS, COLS >::getRow ( uint row) const
inline

◆ getScale()

template<typename T , uint ROWS, uint COLS>
template<uint LENGTH>
const Vector< T, LENGTH > Matrix< T, ROWS, COLS >::getScale ( ) const
inline

◆ invert()

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS > & Matrix< T, ROWS, COLS >::invert ( )
inline

◆ isSquare()

template<typename T , uint ROWS, uint COLS>
bool Matrix< T, ROWS, COLS >::isSquare ( ) const
inline

◆ loadIdentity()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::loadIdentity ( )
inline

Coverts current matrix to an identity-matrix.

Parameters
pMarixThe buffer to convert to the identity matrix.
Returns
void

◆ matrixTo()

template<typename T , uint ROWS, uint COLS>
static const Quaternion< T > Matrix< T, ROWS, COLS >::matrixTo ( const Matrix< T, 3, 3 > & mat)
inlinestatic

◆ normal()

template<typename T , uint ROWS, uint COLS>
template<uint LENGTH>
const Matrix< T, LENGTH, LENGTH > Matrix< T, ROWS, COLS >::normal ( ) const
inline

◆ normalize()

template<typename T , uint ROWS, uint COLS>
template<uint LENGTH>
void Matrix< T, ROWS, COLS >::normalize ( )
inline

◆ operator!=()

template<typename T , uint ROWS, uint COLS>
const bool Matrix< T, ROWS, COLS >::operator!= ( const Matrix< T, ROWS, COLS > & other) const
inline

◆ operator=() [1/3]

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::operator= ( const Matrix< T, ROWS - 1, COLS - 1 > & other)
inline

◆ operator=() [2/3]

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::operator= ( const Matrix< T, ROWS+1, COLS+1 > & other)
inline

◆ operator=() [3/3]

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::operator= ( const Matrix< T, ROWS, COLS > & other)
inline

◆ operator==()

template<typename T , uint ROWS, uint COLS>
const bool Matrix< T, ROWS, COLS >::operator== ( const Matrix< T, ROWS, COLS > & other) const
inline

◆ operator[]() [1/2]

template<typename T , uint ROWS, uint COLS>
T * Matrix< T, ROWS, COLS >::operator[] ( const uint index)
inline

◆ operator[]() [2/2]

template<typename T , uint ROWS, uint COLS>
const T * Matrix< T, ROWS, COLS >::operator[] ( const uint index) const
inline

◆ print()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::print ( ) const
inline

◆ rotate()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::rotate ( T angle,
const Vector< T, 3 > & vec )
inline

◆ rotation()

template<typename T , uint ROWS, uint COLS>
const Matrix< T, ROWS, COLS > Matrix< T, ROWS, COLS >::rotation ( T angle,
const Vector< T, 3 > & vec ) const
inline

◆ rows()

template<typename T , uint ROWS, uint COLS>
uint Matrix< T, ROWS, COLS >::rows ( ) const
inline

◆ scale() [1/2]

template<typename T , uint ROWS, uint COLS>
template<uint LENGTH>
void Matrix< T, ROWS, COLS >::scale ( const Vector< T, LENGTH > & vec)
inline

◆ scale() [2/2]

template<typename T , uint ROWS, uint COLS>
template<uint LENGTH>
void Matrix< T, ROWS, COLS >::scale ( T scale)
inline

A uniform scale

◆ scaleTo()

template<typename T , uint ROWS, uint COLS>
template<uint LENGTH>
void Matrix< T, ROWS, COLS >::scaleTo ( const Vector< T, LENGTH > & vec)
inline

◆ set()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::set ( const Matrix< T, ROWS, COLS > & src)
inline

◆ setCol()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::setCol ( uint col,
const Vector< T, COLS > & v )
inline

◆ setRow()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::setRow ( uint row,
const Vector< T, ROWS > & v )
inline

◆ toMatrix()

template<typename T , uint ROWS, uint COLS>
static const Matrix< T, 3, 3 > Matrix< T, ROWS, COLS >::toMatrix ( const Quaternion< T > & q)
inlinestatic

◆ transform()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::transform ( const Matrix< T, ROWS, COLS > & src)
inline

◆ translate()

template<typename T , uint ROWS, uint COLS>
void Matrix< T, ROWS, COLS >::translate ( const Vector< T, 3 > & vec)
inline

◆ translation()

template<typename T , uint ROWS, uint COLS>
const Matrix< T, ROWS, COLS > Matrix< T, ROWS, COLS >::translation ( const Vector< T, 3 > & vec) const
inline

◆ transpose()

template<typename T , uint ROWS, uint COLS>
Matrix< T, ROWS, COLS > & Matrix< T, ROWS, COLS >::transpose ( )
inline

Member Data Documentation

◆ identity

template<typename T , uint ROWS, uint COLS>
const Matrix< T, ROWS, COLS > Matrix< T, ROWS, COLS >::identity = Matrix< T, ROWS, COLS >::createIdentityMatrix()
static

◆ m

template<typename T , uint ROWS, uint COLS>
T Matrix< T, ROWS, COLS >::m[ROWS][COLS]

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