torque Torque Game Engine Documentation
TGE Version 1.5.2

MathUtils Namespace Reference


Detailed Description

Miscellaneous math utility functions.


Functions

MatrixF createOrientFromDir (Point3F &direction)
 Creates orientation matrix from a direction vector. Assumes ( 0 0 1 ) is up.
Point3F randomDir (Point3F &axis, F32 thetaAngleMin, F32 thetaAngleMax, F32 phiAngleMin=0.0f, F32 phiAngleMax=360.0f)
 Creates random direction given angle parameters similar to the particle system.
void getAnglesFromVector (VectorF &vec, F32 &yawAng, F32 &pitchAng)
 Returns yaw and pitch angles from a given vector.
void getVectorFromAngles (VectorF &vec, F32 &yawAng, F32 &pitchAng)
 Returns vector from given yaw and pitch angles.
void transformBoundingBox (const Box3F &sbox, const MatrixF &mat, const Point3F scale, Box3F &dbox)


Function Documentation

MatrixF MathUtils::createOrientFromDir ( Point3F direction  ) 

Creates orientation matrix from a direction vector. Assumes ( 0 0 1 ) is up.

Point3F MathUtils::randomDir ( Point3F axis,
F32  thetaAngleMin,
F32  thetaAngleMax,
F32  phiAngleMin = 0.0f,
F32  phiAngleMax = 360.0f 
)

Creates random direction given angle parameters similar to the particle system.

The angles are relative to the specified axis. Both phi and theta are in degrees.

void MathUtils::getAnglesFromVector ( VectorF vec,
F32 yawAng,
F32 pitchAng 
)

Returns yaw and pitch angles from a given vector.

Angles are in RADIANS.

Assumes north is (0.0, 1.0, 0.0), the degrees move upwards clockwise.

The range of yaw is 0 - 2PI. The range of pitch is -PI/2 - PI/2.

ASSUMES Z AXIS IS UP

void MathUtils::getVectorFromAngles ( VectorF vec,
F32 yawAng,
F32 pitchAng 
)

Returns vector from given yaw and pitch angles.

Angles are in RADIANS.

Assumes north is (0.0, 1.0, 0.0), the degrees move upwards clockwise.

The range of yaw is 0 - 2PI. The range of pitch is -PI/2 - PI/2.

ASSUMES Z AXIS IS UP

void MathUtils::transformBoundingBox ( const Box3F sbox,
const MatrixF mat,
const Point3F  scale,
Box3F dbox 
)




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen