iaux::iaMatrix< T > Class Template Reference

#include <iaMatrix.h>

Public Member Functions

void operator+= (iaMatrix &a)
 
void operator-= (iaMatrix &a)
 
bool operator== (const iaMatrix< T > &a) const
 
bool operator!= (const iaMatrix< T > &a) const
 
iaVector3< T > operator* (iaVector3< T > &a) const
 
iaVector3< T > operator* (const iaVector3< T > &a) const
 
iaVector4< T > operator* (iaVector4< T > &a) const
 
iaVector4< T > operator* (const iaVector4< T > &a) const
 
iaMatrix operator* (const iaMatrix &m)
 
void operator*= (const iaMatrix &m)
 
T & operator[] (int i)
 
operator[] (int i) const
 
void identity ()
 
determinant ()
 
determinant3x3 ()
 
bool invert ()
 
void transpose ()
 
void lookAt (const iaVector3< T > &eye, const iaVector3< T > &coi, const iaVector3< T > &top)
 
void frustum (T left, T right, T bottom, T top, T nearPlain, T farPlain)
 
void perspective (T fov, T aspect, T nearPlain, T farPlain)
 
void ortho (T left, T right, T bottom, T top, T nearPlain, T farPlain)
 
void grammSchmidt (iaVector3< T > &depth)
 
void grammSchmidt (iaVector3< T > &depth, iaVector3< T > &top)
 
void translate (const iaVector3< T > &a)
 
void translate (T x, T y, T z)
 
void scale (const iaVector3< T > &s)
 
void scale (T x, T y, T z)
 
void move (T distance, iaAxis axis)
 
void move (const iaVector3< T > &v)
 
void rotate (T angle, iaAxis axis)
 
void rotate (const iaVector3< T > &vec)
 
void rotate (T x, T y, T z)
 
void shear (const iaVector3< T > &vec)
 
void shear (T xy, T xz, T yz)
 
const T * getData () const
 
T * getData ()
 
void setData (const T *data)
 
template<class T2 >
iaMatrix< T2 > convert ()
 
 iaMatrix ()
 
 ~iaMatrix ()
 
template<class T2 >
iaMatrix< T2 > convert ()
 

Public Attributes

iaVector3< T > _right
 
_w0 = static_cast<T>(0)
 
iaVector3< T > _top
 
_w1 = static_cast<T>(0)
 
iaVector3< T > _depth
 
_w2 = static_cast<T>(0)
 
iaVector3< T > _pos
 
_w3 = static_cast<T>(0)
 

Detailed Description

template<class T>
class iaux::iaMatrix< T >

right handed 4x4 Matrix

data by name

_right._x | _top._x | _depth._x | _pos.x _right._y | _top._y | _depth._y | _pos.y _right._z | _top._z | _depth._z | _pos.z _w0 | _w1 | _w2 | _w3

data by index (index equals to position in memory)

0 | 4 | 8 | 12 1 | 5 | 9 | 13 2 | 6 | 10 | 14 3 | 7 | 11 | 15

corresponds to

0,0 | 1,0 | 2,0 | 3,0 0,1 | 1,1 | 2,1 | 3,1 0,2 | 1,2 | 2,2 | 3,2 0,3 | 1,3 | 2,3 | 3,3

shear

1 | 0 | 0 | 0 z (xy) | 1 | 0 | 0 y (xz) | x (yz) | 1 | 0 0 | 0 | 0 | 1

translate

1 | 0 | 0 | x 0 | 1 | 0 | y 0 | 0 | 1 | z 0 | 0 | 0 | 1

scale

x | 0 | 0 | 0 0 | y | 0 | 0 0 | 0 | z | 0 0 | 0 | 0 | 1

rotate X

1 | 0 | 0 | 0 0 | cos(a) | -sin(a) | 0 0 | sin(a) | cos(a) | 0 0 | 0 | 0 | 1

rotate Y

cos(a) | 0 | sin(a) | 0 0 | 1 | 0 | 0 -sin(a) | 0 | cos(a) | 0 0 | 0 | | 1

rotate Z

cos(a) | -sin(a) | 0 | 0 sin(a) | cos(a) | 0 | 0 0 | 0 | 1 | 0 0 | 0 | 0 | 1

Constructor & Destructor Documentation

◆ iaMatrix()

template<class T >
iaMatrix::iaMatrix ( )

initializes the matrix with the id matrix

◆ ~iaMatrix()

template<class T >
iaMatrix::~iaMatrix ( )

does nothing

Member Function Documentation

◆ convert() [1/2]

template<class T >
template<class T2 >
iaMatrix< T2 > iaux::iaMatrix< T >::convert ( )

converts the vector in to given type of vector

Returns
matrix for given type

◆ convert() [2/2]

template<class T >
template<class T2 >
iaMatrix< T2 > iaux::iaMatrix< T >::convert ( )

◆ determinant()

template<class T >
IGOR_INLINE T iaMatrix::determinant ( )

returns the determinant of the matrix

◆ determinant3x3()

template<class T >
IGOR_INLINE T iaMatrix::determinant3x3 ( )

returns the determinant of the 3x3 part of the matrix

◆ frustum()

template<class T >
IGOR_INLINE void iaMatrix::frustum ( left,
right,
bottom,
top,
nearPlain,
farPlain 
)

calculates a frustum matrix

Parameters
leftthe left value
rightthe right value
bottomthe bottom value
topthe top value
nearPlainthe near plain distance
farPlainthe far plain distance

◆ getData() [1/2]

template<class T >
IGOR_INLINE T * iaMatrix::getData ( )
Returns
pointer to the data

◆ getData() [2/2]

template<class T >
IGOR_INLINE const T * iaMatrix::getData ( ) const
Returns
pointer to the data

◆ grammSchmidt() [1/2]

template<class T >
IGOR_INLINE void iaMatrix::grammSchmidt ( iaVector3< T > &  depth)

calculates a orthogonal matrix based on one direction

does only change the orientation of this matrix the vector does not have top be normalized

Parameters
depththe direction the matrix bases on

◆ grammSchmidt() [2/2]

template<class T >
IGOR_INLINE void iaMatrix::grammSchmidt ( iaVector3< T > &  depth,
iaVector3< T > &  top 
)

calculates a orthogonal matrix based on a plane with primary direction depth

does only change the orientation of this matrix the vectors do not have to be perpendicular the vectors do not have to be normalized

Parameters
depththe direction the matrix bases on
topthe second vector to define the plane

◆ identity()

template<class T >
IGOR_INLINE void iaMatrix::identity ( )

initializes matrix with id matrix

◆ invert()

template<class T >
IGOR_INLINE bool iaMatrix::invert ( )

calculates the inverse of the matrix and overwrites the original value

◆ lookAt()

template<class T >
IGOR_INLINE void iaMatrix::lookAt ( const iaVector3< T > &  eye,
const iaVector3< T > &  coi,
const iaVector3< T > &  top 
)

calculates a view matrix

Parameters
eyeeye point of the camera
coicenter of interesst
topthe ipvector of the camera

◆ move() [1/2]

template<class T >
IGOR_INLINE void iaMatrix::move ( const iaVector3< T > &  v)

translate the matrix along it's own orientation vectors by given vector

Parameters
vthe given vector

◆ move() [2/2]

template<class T >
IGOR_INLINE void iaMatrix::move ( distance,
iaAxis  axis 
)

translate the matrix along it's own orientation vectors

Parameters
distancedistance to translate the matrix
axisaxis to translate along

◆ operator!=()

template<class T >
IGOR_INLINE bool iaMatrix::operator!= ( const iaMatrix< T > &  a) const

negated comparison of two matrices

Parameters
athe second matrix to compare this matrix with
Returns
true if matrices are not equal

◆ operator*() [1/5]

template<class T >
iaMatrix iaux::iaMatrix< T >::operator* ( const iaMatrix< T > &  m)

matrix multiplication

◆ operator*() [2/5]

template<class T >
IGOR_INLINE iaVector3< T > iaMatrix::operator* ( const iaVector3< T > &  a) const

matrix vector3 multiplication

◆ operator*() [3/5]

template<class T >
IGOR_INLINE iaVector4< T > iaMatrix::operator* ( const iaVector4< T > &  a) const

matrix vector4 multiplication

◆ operator*() [4/5]

template<class T >
IGOR_INLINE iaVector3< T > iaMatrix::operator* ( iaVector3< T > &  a) const

matrix vector3 multiplication

◆ operator*() [5/5]

template<class T >
IGOR_INLINE iaVector4< T > iaMatrix::operator* ( iaVector4< T > &  a) const

matrix vector4 multiplication

◆ operator*=()

template<class T >
IGOR_INLINE void iaMatrix::operator*= ( const iaMatrix< T > &  m)

matrix multiplication

◆ operator+=()

template<class T >
IGOR_INLINE void iaMatrix::operator+= ( iaMatrix< T > &  a)

addition

◆ operator-=()

template<class T >
IGOR_INLINE void iaMatrix::operator-= ( iaMatrix< T > &  a)

subtraction

◆ operator==()

template<class T >
IGOR_INLINE bool iaMatrix::operator== ( const iaMatrix< T > &  a) const

comparison of two matrices

Parameters
athe second matrix to compare this matrix with
Returns
true if matrices are equal

◆ operator[]() [1/2]

template<class T >
IGOR_INLINE T & iaMatrix::operator[] ( int  i)

matrix component by index

Parameters
ionly indexes from 0 to 15 are allowed

◆ operator[]() [2/2]

template<class T >
IGOR_INLINE T iaMatrix::operator[] ( int  i) const

◆ ortho()

template<class T >
IGOR_INLINE void iaMatrix::ortho ( left,
right,
bottom,
top,
nearPlain,
farPlain 
)

calculates a othogonal projection matrix

Parameters
leftthe left value
rightthe right value
bottomthe bottom value
topthe top value
nearPlainthe near plain distance
farPlainthe far plain distance

◆ perspective()

template<class T >
IGOR_INLINE void iaMatrix::perspective ( fov,
aspect,
nearPlain,
farPlain 
)

calculates a perspective projection matrix

Parameters
fovfield of view in degrees
aspectaspect ratio
nearPlainnear clipping plane distance
farPlainfar clipping plane distance

◆ rotate() [1/3]

template<class T >
IGOR_INLINE void iaMatrix::rotate ( const iaVector3< T > &  vec)

rotates matrix in three axis

Parameters
vecthe rotation vector

◆ rotate() [2/3]

template<class T >
IGOR_INLINE void iaMatrix::rotate ( angle,
iaAxis  axis 
)

rotates the matrix around a specified orientation vector of the matrix

Parameters
angleangle to rotate in radians
axisaxis to rotate around

◆ rotate() [3/3]

template<class T >
IGOR_INLINE void iaMatrix::rotate ( x,
y,
z 
)

rotates matrix in three axis

Parameters
xx axis
yy axis
zz axis

◆ scale() [1/2]

template<class T >
IGOR_INLINE void iaMatrix::scale ( const iaVector3< T > &  s)

scale matrix by vector

Parameters
sscale vector

◆ scale() [2/2]

template<class T >
IGOR_INLINE void iaMatrix::scale ( x,
y,
z 
)

scales the matrix

Parameters
xscale in x axis
yscale in y axis
zscale in z axis

◆ setData()

template<class T >
IGOR_INLINE void iaMatrix::setData ( const T *  data)

set data

◆ shear() [1/2]

template<class T >
IGOR_INLINE void iaMatrix::shear ( const iaVector3< T > &  vec)

shears matrix in three axis

Parameters
vecthe shear vector

◆ shear() [2/2]

template<class T >
IGOR_INLINE void iaMatrix::shear ( xy,
xz,
yz 
)

shears matrix in three axis

Parameters
xyshear in xy plane
xzshear in yz plane
yzshear in yz plane

◆ translate() [1/2]

template<class T >
IGOR_INLINE void iaMatrix::translate ( const iaVector3< T > &  a)

translate the matrix by vector 3d

Parameters
atranslation vector

◆ translate() [2/2]

template<class T >
IGOR_INLINE void iaMatrix::translate ( x,
y,
z 
)

translate the matrix by vector 3d

Parameters
xx component
yy component
zz component

◆ transpose()

template<class T >
IGOR_INLINE void iaMatrix::transpose ( )

transposes the matrix

Member Data Documentation

◆ _depth

template<class T >
iaVector3<T> iaux::iaMatrix< T >::_depth

◆ _pos

template<class T >
iaVector3<T> iaux::iaMatrix< T >::_pos

◆ _right

template<class T >
iaVector3<T> iaux::iaMatrix< T >::_right

internal data

◆ _top

template<class T >
iaVector3<T> iaux::iaMatrix< T >::_top

◆ _w0

template<class T >
T iaux::iaMatrix< T >::_w0 = static_cast<T>(0)

◆ _w1

template<class T >
T iaux::iaMatrix< T >::_w1 = static_cast<T>(0)

◆ _w2

template<class T >
T iaux::iaMatrix< T >::_w2 = static_cast<T>(0)

◆ _w3

template<class T >
T iaux::iaMatrix< T >::_w3 = static_cast<T>(0)

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