Propane::Math Namespace Reference

Classes and methods that provide helpful math functionality. More...


Classes

class  Frustum
 A solid that can be used to determine visibility information. More...
class  Matrix
 A square matrix class for managing 3D (NOT INTENDED for scientific purposes or speed). More...
class  Plane
class  Quaternion
 3D Quaternion class for complex rotation More...

Typedefs

typedef Matrix< 3, double > Matrix3d
 3x3 high precision type
typedef Matrix< 4, double > Matrix4d
 4x4 high precision type
typedef Matrix< 3, float > Matrix3
 3x3 matrix type
typedef Matrix< 4, float > Matrix4
 4x4 matrix type

Functions

float linearInterpolate (float f1, float f2, float amt)
float barycentric (float v1, float v2, float v3, float a1, float a2)
float randomFloat (float min, float max)
Propane::Math::Matrix4 getMatrix (GLenum matrixName)
template<size_t N, class T>
std::ostream & operator<< (std::ostream &os, const Matrix< N, T > &m)
 Debugging output.
template<class T>
Matrix< 4, T > rotation3D (const Vector< 3, T > &axis, double radians)
 Arbitrary axis rotation in 3D.
template<class T>
Matrix< 4, T > rotationX (double rads)
 Rotation about the X axis.
template<class T>
Matrix< 4, T > rotationY (double rads)
 Rotation about the Y axis.
template<class T>
Matrix< 4, T > rotationZ (double rads)
 Rotation about the Z axis.
template<class T>
Matrix< 3, T > rotation2D (double rads)
 Rotation about the Z axis (in 2D).
template<size_t N, class T>
Matrix< N, T > scaling (const Vector< N, T > &scale)
 Scaling in 2D/3D.
template<size_t N, class T>
Matrix< N, T > translation (const Vector< N, T > &translate)
 Translating in 2D/3D.
template<class T>
Vector< 3, T > cross (const Vector< 3, T > &v1, const Vector< 3, T > &v2)
 Cross product.
template<class T>
Vector< 4, T > cross (const Vector< 4, T > &v1, const Vector< 4, T > &v2)
 Cross product for 4-vector, ignoring the w-component.
template<size_t N, class T>
Vector< N, T > operator * (double s, const Vector< N, T > &v)
 Scale with l-value double.


Detailed Description

Classes and methods that provide helpful math functionality.

Function Documentation

float Propane::Math::barycentric float  v1,
float  v2,
float  v3,
float  a1,
float  a2
 

Converts a 2D coordinate to barycentric coordinates along a single axis

Parameters:
v1 The first vertex of the triangle
v2 The second vertex of the triangle
v3 The third vertex of the triangle
a1 The X-coordinate
a2 The Y-coordinate
Returns:
The coordinate along that axis in barycentric coordinates

Propane::Math::Matrix4 Propane::Math::getMatrix GLenum  matrixName  ) 
 

Gets a matrix from OpenGL and converts it to the Propane Injector Matrix format.

Parameters:
matrixName The matrix you want to get (GL_PROJECTION_MATRIX, GL_MODELVIEW_MATRIX are the only ones supported).
Returns:
A Propane::Math::Matrix4 of the requested matrix.

float Propane::Math::linearInterpolate float  f1,
float  f2,
float  amt
 

Linearly interpolate between two values

Parameters:
f1 The first value
f2 The second value
amt The fractional amount between the two values to interpolate

float Propane::Math::randomFloat float  min,
float  max
 

Get a random floating point number between two bounds

Parameters:
min The minimum floating point number.
max The maximum floating point number. If this is less than min, this function always returns 0.
Returns:
The random floating point number, or 0 if max < min
Examples:
ShaderUse.cpp.


Generated on Sun Jan 14 16:49:12 2007 for Propane Injector by  doxygen 1.4.6