Main Page   Class Hierarchy   Compound List   File List   Compound Members  

BaMath Class Reference

Container for a variety of useful mathematics functions. More...

#include <freecloth/base/baMath.h>

List of all members.

Static Public Member Functions

Float ceil (Float)
Float floor (Float)
Float round (Float)
Int8 roundTruncInt8 (Float)
 This will cap values to the range [-128,127].

UInt8 roundTruncUInt8 (Float)
 This will cap values to the range [0,255].

Int16 roundTruncInt16 (Float)
 This will cap values to the range [-32768,32767].

UInt16 roundTruncUInt16 (Float)
 This will cap values to the range [0,65535].

Float abs (Float)
bool isInteger (Float)
 Returns true if input is an integer (or within tolerance).

bool isPow2 (UInt32)
 Returns true if input is a power of two.

UInt32 roundUpPow2 (UInt32)
 Rounds input up to nearest power of two.

Float sqr (Float)
Float sqrt (Float)
Float cos (Float)
Float sin (Float)
Float tan (Float)
Float arccos (Float)
Float arcsin (Float)
Float arctan (Float)
Float arctan2 (Float y, Float x)
Float sinc (Float)
Float exp (Float)
Float log (Float)
UInt32 randomUInt32 ()
UInt32 randomUInt32 (UInt32 nbVals)
Float randomFloat ()
Int8 ceilInt8 (Float)
Int8 floorInt8 (Float)
Int8 roundInt8 (Float)
UInt8 ceilUInt8 (Float)
UInt8 floorUInt8 (Float)
UInt8 roundUInt8 (Float)
Int16 ceilInt16 (Float)
Int16 floorInt16 (Float)
Int16 roundInt16 (Float)
UInt16 ceilUInt16 (Float)
UInt16 floorUInt16 (Float)
UInt16 roundUInt16 (Float)
Int32 ceilInt32 (Float)
Int32 floorInt32 (Float)
Int32 roundInt32 (Float)
UInt32 ceilUInt32 (Float)
UInt32 floorUInt32 (Float)
UInt32 roundUInt32 (Float)
bool isEqual (Float a, Float b, Float tol=TOLERANCE)
bool isGreater (Float a, Float b, Float tol=TOLERANCE)
bool isLess (Float a, Float b, Float tol=TOLERANCE)

Static Public Attributes

const Float TOLERANCE = 10e-4f


Detailed Description

Container for a variety of useful mathematics functions.

This class is intended to provide clean platform-independent access to standard routines. It also groups a number of useful new routines, such as floating-point comparisons using tolerances.

Definition at line 50 of file baMath.h.


Member Function Documentation

Int16 BaMath::ceilInt16 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 74 of file baMath.cpp.

Int32 BaMath::ceilInt32 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 116 of file baMath.cpp.

Int8 BaMath::ceilInt8 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 32 of file baMath.cpp.

UInt16 BaMath::ceilUInt16 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 95 of file baMath.cpp.

UInt32 BaMath::ceilUInt32 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 137 of file baMath.cpp.

UInt8 BaMath::ceilUInt8 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 53 of file baMath.cpp.

Int16 BaMath::floorInt16 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 81 of file baMath.cpp.

Int32 BaMath::floorInt32 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 123 of file baMath.cpp.

Int8 BaMath::floorInt8 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 39 of file baMath.cpp.

UInt16 BaMath::floorUInt16 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 102 of file baMath.cpp.

UInt32 BaMath::floorUInt32 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 144 of file baMath.cpp.

UInt8 BaMath::floorUInt8 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 60 of file baMath.cpp.

bool BaMath::isEqual Float    a,
Float    b,
Float    tol = TOLERANCE
[static]
 

Values a and b are considered equal if they differ by less than the tolerance.

Definition at line 270 of file baMath.cpp.

Referenced by SimSimulator::setPosConstraintLine().

bool BaMath::isGreater Float    a,
Float    b,
Float    tol = TOLERANCE
[static]
 

Values a and b are considered equal if they differ by less than the tolerance.

Definition at line 277 of file baMath.cpp.

bool BaMath::isLess Float    a,
Float    b,
Float    tol = TOLERANCE
[static]
 

Values a and b are considered equal if they differ by less than the tolerance.

Definition at line 284 of file baMath.cpp.

Float BaMath::randomFloat   [static]
 

Returns a value between 0 and 1, in a pseudo-random uniform distribution.

Definition at line 263 of file baMath.cpp.

UInt32 BaMath::randomUInt32 UInt32    nbVals [static]
 

Returns a 32-bit value in the range [0,nbVals) using a pseudo-random uniform distribution.

Definition at line 256 of file baMath.cpp.

References randomUInt32().

UInt32 BaMath::randomUInt32   [static]
 

Returns a 32-bit value containing random bits, according to a a pseudo-random uniform distribution.

Definition at line 242 of file baMath.cpp.

Referenced by randomUInt32().

Int16 BaMath::roundInt16 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 88 of file baMath.cpp.

Int32 BaMath::roundInt32 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 130 of file baMath.cpp.

Int8 BaMath::roundInt8 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 46 of file baMath.cpp.

UInt16 BaMath::roundUInt16 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 109 of file baMath.cpp.

UInt32 BaMath::roundUInt32 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 151 of file baMath.cpp.

UInt8 BaMath::roundUInt8 Float    [static]
 

Note that no truncation is performed. If the value is out of range, it will be wrapped around.

Definition at line 67 of file baMath.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 15:58:52 2003 for Freecloth by doxygen1.3-rc3