torque Torque Game Engine Documentation
CVS Revision Label 1.3.x

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.0, F32 phiAngleMax=360.0)
 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.


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.0,
F32  phiAngleMax = 360.0
 

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




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