Matrix3< T > Struct Template Reference

Matrix3 class. More...

#include <matrix.h>

List of all members.

Public Types

enum  { size = 9, cols = 3, rows = 3 }
typedef T ElemType
typedef Vector3< T > RowType

Public Member Functions

 Matrix3 ()
 default constructor
 Matrix3 (T t)
 Init all elements with the same value.
template<class U >
 Matrix3 (const Matrix3< U > &m)
 Init with another Matrix of another type.
 Matrix3 (const T *t)
 Init from array with equal size.
 Matrix3 (T _t00, T _t01, T _t02, T _t10, T _t11, T _t12, T _t20, T _t21, T _t22)
 Init componentwisely.
 Matrix3 (const Vector3< T > &v1, const Vector3< T > &v2, const Vector3< T > &v3)
 Init with three Vector3.
const Vector3< T > & operator[] (size_t i) const
 return arbitrary row-vector similar to GLSL.
Vector3< T > & operator[] (size_t i)
 return arbitrary row-vector similar to GLSL.

Static Public Member Functions

static Matrix3< T > createZero ()
static Matrix3< T > createIdentity ()
static Matrix3< T > createTranslation (const Vector2< T > &v)
static Matrix3< T > createScale (const Vector3< T > &v)
static Matrix3< T > createRotationX (T angle)
 Rotation the x-axis as rotation axis.
static Matrix3< T > createRotationY (T angle)
 Rotation the y-axis as rotation axis.
static Matrix3< T > createRotationZ (T angle)
 Rotation the z-axis as rotation axis.
static Matrix3< T > createRotation (T angle, Vector3< T > axis)
 Simliar to glRotate but angle is in RADIAN AND NOT DEGREE.

Public Attributes

union {
   struct {
      T   t00
      T   t01
      T   t02
      T   t10
      T   t11
      T   t12
      T   t20
      T   t21
      T   t22
   } 
   T   elemRowCol [3][3]
   T   elem [9]
}; 

Static Public Attributes

static const Matrix3< T > zero
 init statics
static const Matrix3< T > identity

Detailed Description

template<class T>
struct tgt::Matrix3< T >

Matrix3 class.

Works basicly like the matrix stuff in GLSL. But remember that this is a ROW-MATRIX and NOT a COL-MATRIX like in OpenGL or GLSL respectively.

Definition at line 204 of file matrix.h.


Member Function Documentation

TGT_IMPLEMENT_OPERATORS TGT_IMPLEMENT_MAT_FUNCTIONS Matrix3< T > createRotation ( angle,
Vector3< T >  axis 
) [inline, static]

Simliar to glRotate but angle is in RADIAN AND NOT DEGREE.

Parameters:
angle The angle in radian.
axis The axis of rotation. Needn't be in unit length.

Definition at line 963 of file matrix.h.

static Matrix3<T> createRotationX ( angle  )  [inline, static]

Rotation the x-axis as rotation axis.

The angle is in RADIAN AND NOT DEGREE.

Parameters:
angle The angle of rotation in radian.

Definition at line 299 of file matrix.h.

static Matrix3<T> createRotationY ( angle  )  [inline, static]

Rotation the y-axis as rotation axis.

The angle is in RADIAN AND NOT DEGREE.

Parameters:
angle The angle of rotation in radian.

Definition at line 314 of file matrix.h.

static Matrix3<T> createRotationZ ( angle  )  [inline, static]

Rotation the z-axis as rotation axis.

The angle is in RADIAN AND NOT DEGREE.

Parameters:
angle The angle of rotation in radian.

Definition at line 329 of file matrix.h.

Vector3<T>& operator[] ( size_t  i  )  [inline]

return arbitrary row-vector similar to GLSL.


BUT REMEMBER: GLSL gives you COLS NOT ROWS!

Definition at line 362 of file matrix.h.

const Vector3<T>& operator[] ( size_t  i  )  const [inline]

return arbitrary row-vector similar to GLSL.


BUT REMEMBER: GLSL gives you COLS NOT ROWS!

Definition at line 356 of file matrix.h.


Member Data Documentation

const Matrix3< T > identity [inline, static]
Initial value:
 Matrix3<T>
(
    T(1), T(0), T(0),
    T(0), T(1), T(0),
    T(0), T(0), T(1)
)

Definition at line 268 of file matrix.h.

const Matrix3< T > zero [inline, static]
Initial value:
 Matrix3<T>
(
    T(0), T(0), T(0),
    T(0), T(0), T(0),
    T(0), T(0), T(0)
)

init statics

Definition at line 267 of file matrix.h.