Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Math< T > Class Template Reference

#include <mathlib.h>

List of all members.

Static Public Member Functions

static T clamp (T t)
static T frand ()
static T lerp (T t, T a, T b)
static T sfrand ()
static void sincos (T, T &, T &)

Private Member Functions

 Math ()

template<class T>
class Math< T >


Constructor & Destructor Documentation

template<class T>
Math< T >::Math  )  [inline, private]
 

Definition at line 29 of file mathlib.h.

00029 {};


Member Function Documentation

template<class T>
T Math< T >::clamp t  )  [inline, static]
 

Definition at line 131 of file mathlib.h.

Referenced by Renderer::render().

00132 {
00133     if (t < 0)
00134         return 0;
00135     else if (t > 1)
00136         return 1;
00137     else
00138         return t;
00139 }

template<class T>
T Math< T >::frand  )  [inline, static]
 

Definition at line 111 of file mathlib.h.

00112 {
00113     return (T) (rand() & 0x7fff) / (T) 32767;
00114 }

template<class T>
T Math< T >::lerp t,
a,
b
[inline, static]
 

Definition at line 124 of file mathlib.h.

Referenced by noise1(), noise2(), noise3(), renderAtmosphere(), Renderer::renderEllipsoidAtmosphere(), and slerp().

00125 {
00126     return a + t * (b - a);
00127 }

template<class T>
T Math< T >::sfrand  )  [inline, static]
 

Definition at line 118 of file mathlib.h.

Referenced by init().

00119 {
00120     return (T) (rand() & 0x7fff) / (T) 32767 * 2 - 1;
00121 }

template<class T>
void Math< T >::sincos ,
T &  ,
T & 
[inline, static]
 

Definition at line 103 of file mathlib.h.

References cos(), and sin().

Referenced by Quaternion< T >::setAxisAngle(), Quaternion< T >::xrotate(), Quaternion< T >::xrotation(), Quaternion< T >::yrotate(), Quaternion< T >::yrotation(), Quaternion< T >::zrotate(), and Quaternion< T >::zrotation().

00104 {
00105     s = (T) sin(angle);
00106     c = (T) cos(angle);
00107 }


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:27 2006 for Celestia by  doxygen 1.4.1