#include <vhdMath.h>
Public Types | |
| enum | AngleUnit { AU_DEGREE, AU_RADIAN } |
Public Member Functions | |
| vhdMath (unsigned int uiTrigTableSize=4096) | |
| ~vhdMath () | |
Static Public Member Functions | |
| static int | iAbs (int iValue) |
| static int | iCeil (float fValue) |
| static int | iFloor (float fValue) |
| static int | iSign (int iValue) |
| static vhtReal | abs (vhtReal fValue) |
| static vhtReal | aCos (vhtReal fValue) |
| static vhtReal | aSin (vhtReal fValue) |
| static vhtReal | aTan (vhtReal fValue) |
| static vhtReal | aTan2 (vhtReal fY, vhtReal fX) |
| static vhtReal | ceil (vhtReal fValue) |
| static vhtReal | cos (vhtReal fValue, bool useTables=false) |
| static vhtReal | exp (vhtReal fValue) |
| static vhtReal | floor (vhtReal fValue) |
| static vhtReal | log (vhtReal fValue) |
| static vhtReal | pow (vhtReal kBase, vhtReal kExponent) |
| static vhtReal | sign (vhtReal fValue) |
| static vhtReal | sin (vhtReal fValue, bool useTables=false) |
| static vhtReal | sqr (vhtReal fValue) |
| static vhtReal | sqrt (vhtReal fValue) |
| static vhtReal | invSqrt (vhtReal fValue) |
| static vhtReal | unitRandom () |
| static vhtReal | rangeRandom (vhtReal fLow, vhtReal fHigh) |
| static vhtReal | symmetricRandom () |
| static unsigned int | rand (unsigned int uiNumber) |
| static vhtReal | randReal () |
| static unsigned int | dice (unsigned int uiNumberFaces) |
| static vhtReal | tan (vhtReal fValue, bool useTables=false) |
| static vhtReal | cot (vhtReal value) |
| static vhtReal | degreesToRadians (vhtReal degrees) |
| static vhtReal | radiansToDegrees (vhtReal radians) |
| static void | setAngleUnit (AngleUnit unit) |
| static AngleUnit | getAngleUnit (void) |
| static vhtReal | angleUnitsToRadians (vhtReal units) |
| static vhtReal | radiansToAngleUnits (vhtReal radians) |
| static bool | pointInTri2D (vhtReal px, vhtReal pz, vhtReal ax, vhtReal az, vhtReal bx, vhtReal bz, vhtReal cx, vhtReal cz) |
| static bool | vhtRealEqual (vhtReal a, vhtReal b, vhtReal tolerance=std::numeric_limits< vhtReal >::epsilon()) |
| template<class _OUT, class _IN> | |
| static _OUT | fast_cast (_IN input) |
| template<class T> | |
| static T | absoluteValue (T value) |
| template<class T> | |
| static bool | isPositive (T a) |
| template<class T> | |
| static bool | isNegative (T a) |
| template<class T> | |
| static bool | sameSigns (T a, T b) |
| template<class T> | |
| static T | copySign (T value, T s) |
| template<class T> | |
| static bool | deltaRangeTest (T a, T b, T epsilon) |
| template<class T> | |
| static bool | deltaRangeTest (T a, T b) |
| template<class T> | |
| static const T & | minimum (const T &a, const T &b) |
| template<class T> | |
| static const T & | maximum (const T &a, const T &b) |
| template<class T> | |
| static const T & | maximum (const T &a, const T &b, const T &c) |
| template<class T> | |
| static T | clamp (T value, T low, T high) |
| template<class T> | |
| static T | clampPositive (T value) |
| template<class T> | |
| static T | clampNegative (T value) |
| template<class T> | |
| static bool | isPowerOfTwo (T input) |
| template<class T> | |
| static T | nearestPowerOfTwo (T input) |
| template<class T> | |
| static T | ceilingPowerOfTwo (T input) |
| template<class T> | |
| static T | modulus (T a, T b) |
| template<class T> | |
| static void | swap (T &a, T &b) |
Static Public Attributes | |
| static const vhtReal | POS_INFINITY |
| static const vhtReal | NEG_INFINITY |
| static const vhtReal | PI |
| static const vhtReal | TWO_PI |
| static const vhtReal | HALF_PI |
| static const vhtReal | MAX_vhtReal |
| static const vhtReal | MIN_vhtReal |
| static const vhtReal | INV_TWO_PI |
| static const vhtReal | DEG_TO_RAD |
| static const vhtReal | RAD_TO_DEG |
| static const vhtReal | G_EPSILON |
| static const vhtReal | EPSILON |
Protected Member Functions | |
| void | buildTrigTables () |
Static Private Attributes | |
| static AngleUnit | msAngleUnit |
| static int | mTrigTableSize |
| static vhtReal | mTrigTableFactor |
| static vhtReal * | mSinTable |
| static vhtReal * | mTanTable |
| enum vhdMath::AngleUnit |
| vhdMath::vhdMath | ( | unsigned int | uiTrigTableSize = 4096 |
) |
| vhdMath::~vhdMath | ( | ) |
| int vhdMath::iAbs | ( | int | iValue | ) | [static] |
| int vhdMath::iCeil | ( | float | fValue | ) | [static] |
| int vhdMath::iFloor | ( | float | fValue | ) | [static] |
| int vhdMath::iSign | ( | int | iValue | ) | [static] |
| vhtReal vhdMath::unitRandom | ( | ) | [static] |
| vhtReal vhdMath::symmetricRandom | ( | ) | [static] |
| unsigned int vhdMath::rand | ( | unsigned int | uiNumber | ) | [static] |
| vhtReal vhdMath::randReal | ( | ) | [static] |
| unsigned int vhdMath::dice | ( | unsigned int | uiNumberFaces | ) | [static] |
| void vhdMath::setAngleUnit | ( | AngleUnit | unit | ) | [static] |
| vhdMath::AngleUnit vhdMath::getAngleUnit | ( | void | ) | [static] |
| bool vhdMath::pointInTri2D | ( | vhtReal | px, | |
| vhtReal | pz, | |||
| vhtReal | ax, | |||
| vhtReal | az, | |||
| vhtReal | bx, | |||
| vhtReal | bz, | |||
| vhtReal | cx, | |||
| vhtReal | cz | |||
| ) | [static] |
| bool vhdMath::vhtRealEqual | ( | vhtReal | a, | |
| vhtReal | b, | |||
| vhtReal | tolerance = std::numeric_limits< vhtReal >::epsilon() | |||
| ) | [static] |
| static _OUT vhdMath::fast_cast | ( | _IN | input | ) | [inline, static] |
| static T vhdMath::absoluteValue | ( | T | value | ) | [inline, static] |
| static bool vhdMath::isPositive | ( | T | a | ) | [inline, static] |
| static bool vhdMath::isNegative | ( | T | a | ) | [inline, static] |
| static bool vhdMath::sameSigns | ( | T | a, | |
| T | b | |||
| ) | [inline, static] |
| static T vhdMath::copySign | ( | T | value, | |
| T | s | |||
| ) | [inline, static] |
| static bool vhdMath::deltaRangeTest | ( | T | a, | |
| T | b, | |||
| T | epsilon | |||
| ) | [inline, static] |
| static bool vhdMath::deltaRangeTest | ( | T | a, | |
| T | b | |||
| ) | [inline, static] |
| static const T& vhdMath::minimum | ( | const T & | a, | |
| const T & | b | |||
| ) | [inline, static] |
| static const T& vhdMath::maximum | ( | const T & | a, | |
| const T & | b | |||
| ) | [inline, static] |
| static const T& vhdMath::maximum | ( | const T & | a, | |
| const T & | b, | |||
| const T & | c | |||
| ) | [inline, static] |
| static T vhdMath::clamp | ( | T | value, | |
| T | low, | |||
| T | high | |||
| ) | [inline, static] |
| static T vhdMath::clampPositive | ( | T | value | ) | [inline, static] |
| static T vhdMath::clampNegative | ( | T | value | ) | [inline, static] |
| static bool vhdMath::isPowerOfTwo | ( | T | input | ) | [inline, static] |
| static T vhdMath::nearestPowerOfTwo | ( | T | input | ) | [inline, static] |
| static T vhdMath::ceilingPowerOfTwo | ( | T | input | ) | [inline, static] |
| static T vhdMath::modulus | ( | T | a, | |
| T | b | |||
| ) | [inline, static] |
| static void vhdMath::swap | ( | T & | a, | |
| T & | b | |||
| ) | [inline, static] |
| void vhdMath::buildTrigTables | ( | ) | [protected] |
const vhtReal vhdMath::POS_INFINITY [static] |
const vhtReal vhdMath::NEG_INFINITY [static] |
const vhtReal vhdMath::PI [static] |
const vhtReal vhdMath::TWO_PI [static] |
const vhtReal vhdMath::HALF_PI [static] |
const vhtReal vhdMath::MAX_vhtReal [static] |
const vhtReal vhdMath::MIN_vhtReal [static] |
const vhtReal vhdMath::INV_TWO_PI [static] |
const vhtReal vhdMath::DEG_TO_RAD [static] |
const vhtReal vhdMath::RAD_TO_DEG [static] |
const vhtReal vhdMath::G_EPSILON [static] |
const vhtReal vhdMath::EPSILON [static] |
vhdMath::AngleUnit vhdMath::msAngleUnit [static, private] |
int vhdMath::mTrigTableSize [static, private] |
vhtReal vhdMath::mTrigTableFactor [static, private] |
vhtReal * vhdMath::mSinTable [static, private] |
vhtReal * vhdMath::mTanTable [static, private] |
1.5.1-p1