#include <KeosMath.h>
Public Member Functions | |
| CMath () | |
| Default constructor. | |
| ~CMath () | |
| Default destructor. | |
Static Public Member Functions | |
| static uint | NearestPowerOfTwo (uint nValue) |
| Return the nearest powewer of two of a number. | |
| static Real | UnitRandom () |
| Return random number in [0,1]. | |
| static Real | RangeRandom (Real fLow, Real fHigh) |
| Return random number in [fLow,fHigh]. | |
| static Real | SymmetricRandom () |
| Return random number in [-1,1]. | |
| static Real | DegreesToRadians (Real degrees) |
| Transform degrees to radians. | |
| static Real | RadiansToDegrees (Real radians) |
| Transform radians to degrees. | |
| static bool | RealEqual (Real a, Real b, Real tolerance=std::numeric_limits< Real >::epsilon()) |
| Compare 2 reals, using tolerance for inaccuracies. | |
| static TVector4F | calculateFaceNormal (const TVector3F &v1, const TVector3F &v2, const TVector3F &v3) |
| Calculate a face normal, including the w component which is the offset from the origin. | |
| static TVector3F | calculateBasicFaceNormal (const TVector3F &v1, const TVector3F &v2, const TVector3F &v3) |
| Calculate a face normal, no w-information. | |
| static TVector4F | calculateFaceNormalWithoutNormalize (const TVector3F &v1, const TVector3F &v2, const TVector3F &v3) |
| Calculate a face normal without normalize, including the w component which is the offset from the origin. | |
| static TVector3F | calculateBasicFaceNormalWithoutNormalize (const TVector3F &v1, const TVector3F &v2, const TVector3F &v3) |
| Calculate a face normal without normalize, no w-information. | |
Static Public Attributes | |
| static const Real | POS_INFINITY |
| static const Real | NEG_INFINITY |
| static const Real | PI |
| static const Real | TWO_PI |
| static const Real | HALF_PI |
| static const Real | fDeg2Rad |
| static const Real | fRad2Deg |
Definition at line 274 of file KeosMath.h.
| Keos::CMath::CMath | ( | ) |
| Keos::CMath::~CMath | ( | ) |
Return the nearest powewer of two of a number.
| nValue | Number to test. |
Definition at line 48 of file KeosMath.cpp.
| Real Keos::CMath::UnitRandom | ( | ) | [static] |
Return random number in [0,1].
Definition at line 65 of file KeosMath.cpp.
Referenced by RangeRandom(), and SymmetricRandom().
Return random number in [fLow,fHigh].
Definition at line 71 of file KeosMath.cpp.
References UnitRandom().
| Real Keos::CMath::SymmetricRandom | ( | ) | [static] |
Return random number in [-1,1].
Definition at line 77 of file KeosMath.cpp.
References UnitRandom().
Transform degrees to radians.
Definition at line 306 of file KeosMath.h.
Referenced by Keos::CDegree::valueRadians().
Transform radians to degrees.
Definition at line 313 of file KeosMath.h.
Referenced by Keos::CRadian::valueDegrees().
| TVector4F Keos::CMath::calculateFaceNormal | ( | const TVector3F & | v1, | |
| const TVector3F & | v2, | |||
| const TVector3F & | v3 | |||
| ) | [static] |
Calculate a face normal, including the w component which is the offset from the origin.
Definition at line 92 of file KeosMath.cpp.
References calculateBasicFaceNormal(), Keos::VectorDot(), Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.
| TVector3F Keos::CMath::calculateBasicFaceNormal | ( | const TVector3F & | v1, | |
| const TVector3F & | v2, | |||
| const TVector3F & | v3 | |||
| ) | [static] |
Calculate a face normal, no w-information.
Definition at line 100 of file KeosMath.cpp.
References Keos::CVector3< T >::Normalize(), and Keos::VectorCross().
Referenced by calculateFaceNormal().
| TVector4F Keos::CMath::calculateFaceNormalWithoutNormalize | ( | const TVector3F & | v1, | |
| const TVector3F & | v2, | |||
| const TVector3F & | v3 | |||
| ) | [static] |
Calculate a face normal without normalize, including the w component which is the offset from the origin.
Definition at line 108 of file KeosMath.cpp.
References calculateBasicFaceNormalWithoutNormalize(), Keos::VectorDot(), Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.
| TVector3F Keos::CMath::calculateBasicFaceNormalWithoutNormalize | ( | const TVector3F & | v1, | |
| const TVector3F & | v2, | |||
| const TVector3F & | v3 | |||
| ) | [static] |
Calculate a face normal without normalize, no w-information.
Definition at line 116 of file KeosMath.cpp.
References Keos::VectorCross().
Referenced by calculateFaceNormalWithoutNormalize().
const Real Keos::CMath::POS_INFINITY [static] |
Definition at line 339 of file KeosMath.h.
const Real Keos::CMath::NEG_INFINITY [static] |
Definition at line 340 of file KeosMath.h.
const Real Keos::CMath::PI [static] |
const Real Keos::CMath::TWO_PI [static] |
const Real Keos::CMath::HALF_PI [static] |
Definition at line 343 of file KeosMath.h.
const Real Keos::CMath::fDeg2Rad [static] |
Definition at line 344 of file KeosMath.h.
const Real Keos::CMath::fRad2Deg [static] |
Definition at line 345 of file KeosMath.h.
1.5.1-p1