55 template <
class T>
static T Sqrt(
T val) {
return sqrt(val);}
56 template <
class T>
static T Abs(
T val) {
return fabs(val);}
58 template <
class T>
static T Sin(
T val) {
return sin(val);}
59 template <
class T>
static T Cos(
T val) {
return cos(val);}
60 template <
class T>
static T Tan(
T val) {
return tan(val);}
68 template <
class T>
static int NumDigits(
T val);
69 template <
class T>
static double GetNormalizedValueRespectingLength(
T val);
73 static bool isEqual(
int32 lhs,
int32 rhs,
int32 tolerance=std::numeric_limits<int32>::epsilon());
74 static bool isEqual(
uint32 lhs,
uint32 rhs,
uint32 tolerance=std::numeric_limits<uint32>::epsilon());
75 static bool isEqual(
float32 lhs,
float32 rhs,
float32 tolerance=std::numeric_limits<float32>::epsilon());
76 static bool isEqual(
float64 lhs,
float64 rhs,
float64 tolerance=std::numeric_limits<float64>::epsilon());
82 static float32 unitRandom32(
void);
83 static float64 unitRandom64(
void);
85 static int rangeRandom(
int iLow,
int iHigh);
88 static bool randomBool(
void);
96 template <
class T>
static T clamp(
T val,
T minval,
T maxval);
103 template <
class T>
static DtVector3<T> toCartesian(
T thetaDegrees,
T phiDegrees,
bool flipYZ);
125 Assert(minval <= maxval &&
"Invalid clamp range");
126 return std::max(std::min(val, maxval), minval);
162 T theta = toRadians(thetaDegrees);
163 T phi = toRadians(phiDegrees);
172 T temp = vPosition.
y;
173 vPosition.
y = vPosition.
z;
194 double normalizedValue = (double)(val)/(double)(std::numeric_limits<T>::max());
195 return normalizedValue;