Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gul::mat4x4 Struct Template Reference

#include <gul_types.h>

List of all members.

Public Methods

vec4< T > & operator[] (size_t i)

Static Public Methods

mat4x4< T > identity ()
 creates 4x4 unit matrix. More...

mat4x4< T > rotate_x (T theta)
 create 4x4 rotation matrix about x axis. More...

mat4x4< T > rotate_y (T theta)
 create 4x4 rotation matrix about y axis. More...

mat4x4< T > rotate_z (T theta)
 create 4x4 rotation matrix about z axis. More...


Public Attributes

vec4< T > m [4]

template<class T>
struct gul::mat4x4< T >


Member Function Documentation

template<class T>
mat4x4<T> gul::mat4x4< T >::identity   [inline, static]
 

creates 4x4 unit matrix.

Definition at line 704 of file gul_types.h.

Referenced by rotate_x(), rotate_y(), and rotate_z().

00705   {
00706     mat4x4 a = { {{{(T)1,(T)0,(T)0,(T)0}},
00707                   {{(T)0,(T)1,(T)0,(T)0}},
00708                   {{(T)0,(T)0,(T)1,(T)0}},
00709                   {{(T)0,(T)0,(T)0,(T)1}}} };
00710     return a;
00711   }

template<class T>
vec4<T>& gul::mat4x4< T >::operator[] size_t    i [inline]
 

Definition at line 700 of file gul_types.h.

00700 { return m[i]; }

template<class T>
mat4x4<T> gul::mat4x4< T >::rotate_x   theta [inline, static]
 

create 4x4 rotation matrix about x axis.

the angle theta (in radians) describes the clockwise rotation, if you look along the axis towards the origin

Definition at line 717 of file gul_types.h.

References identity().

00718   {
00719     mat4x4 a = identity();
00720     T ct = rtr<T>::cos(theta);
00721     T st = rtr<T>::sin(theta);
00722     a[1][1] = a[2][2] = ct;
00723     a[1][2] = -st;
00724     a[2][1] = st;
00725     return a;
00726   }

template<class T>
mat4x4<T> gul::mat4x4< T >::rotate_y   theta [inline, static]
 

create 4x4 rotation matrix about y axis.

the angle theta (in radians) describes the clockwise rotation, if you look along the axis towards the origin

Definition at line 732 of file gul_types.h.

References identity().

00733   {
00734     mat4x4 a = identity();
00735     T ct = rtr<T>::cos(theta);
00736     T st = rtr<T>::sin(theta);
00737     a[0][0] = a[2][2] = ct;
00738     a[0][2] = st;
00739     a[2][0] = -st;
00740     return a;
00741   }

template<class T>
mat4x4<T> gul::mat4x4< T >::rotate_z   theta [inline, static]
 

create 4x4 rotation matrix about z axis.

the angle theta (in radians) describes the clockwise rotation, if you look along the axis towards the origin

Definition at line 747 of file gul_types.h.

References identity().

00748   {
00749     mat4x4 a = identity();
00750     T ct = rtr<T>::cos(theta);
00751     T st = rtr<T>::sin(theta);
00752     a[0][0] = a[1][1] = ct;
00753     a[0][1] = -st;
00754     a[1][0] = st;
00755     return a;
00756   }


Member Data Documentation

template<class T>
vec4<T> gul::mat4x4::m[4]
 

Definition at line 699 of file gul_types.h.


The documentation for this struct was generated from the following file:
Generated on Mon Jan 21 04:17:59 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001