88 o <<
"Radian(" << v.valueRadians() <<
")";
136 inline _OgreExport friend std::ostream&
operator <<
139 o <<
"Degree(" << v.valueDegrees() <<
")";
213 virtual Real getRandomUnit() = 0;
233 void buildTrigTables();
243 Math(
unsigned int trigTableSize = 4096);
249 static inline int IAbs (
int iValue) {
return ( iValue >= 0 ? iValue : -iValue ); }
250 static inline int ICeil (
float fValue) {
return int(ceil(fValue)); }
251 static inline int IFloor (
float fValue) {
return int(floor(fValue)); }
252 static int ISign (
int iValue);
330 return (!useTables) ?
Real(cos(fValue)) : SinTable(fValue + HALF_PI);
365 static inline float saturate(
float t) {
return (t < 0) ? 0 : ((t > 1) ? 1 : t); }
366 static inline double saturate(
double t) {
return (t < 0) ? 0 : ((t > 1) ? 1 : t); }
371 template<
typename V,
typename T>
static V
lerp(
const V& v0,
const V& v1,
const T& t) {
372 return v0 * (1 - t) + v1 * t; }
392 return (!useTables) ?
Real(sin(fValue)) : SinTable(fValue);
434 static Real UnitRandom ();
450 static Real SymmetricRandom ();
452 static void SetRandomValueProvider(RandomValueProvider* provider);
472 return (!useTables) ?
Real(tan(fValue)) : TanTable(fValue);
484 static void setAngleUnit(AngleUnit unit);
486 static AngleUnit getAngleUnit(
void);
489 static Real AngleUnitsToRadians(
Real units);
491 static Real RadiansToAngleUnits(
Real radians);
493 static Real AngleUnitsToDegrees(
Real units);
495 static Real DegreesToAngleUnits(
Real degrees);
548 static std::pair<bool, Real> intersects(
const Ray& ray,
const Plane& plane);
551 static std::pair<bool, Real> intersects(
const Ray& ray,
const Sphere& sphere,
552 bool discardInside =
true);
555 static std::pair<bool, Real> intersects(
const Ray& ray,
const AxisAlignedBox& box);
606 static std::pair<bool, Real> intersects(
const Ray& ray,
const Vector3& a,
608 bool positiveSide =
true,
bool negativeSide =
true);
630 static std::pair<bool, Real> intersects(
const Ray& ray,
const Vector3& a,
632 bool positiveSide =
true,
bool negativeSide =
true);
645 static std::pair<bool, Real> intersects(
647 bool normalIsOutside);
653 static std::pair<bool, Real> intersects(
655 bool normalIsOutside);
660 static bool intersects(
const Sphere& sphere,
const Plane& plane);
664 static bool RealEqual(
Real a,
Real b,
665 Real tolerance = std::numeric_limits<Real>::epsilon());
668 static Vector3 calculateTangentSpaceVector(
686 static Real gaussianDistribution(
Real x,
Real offset = 0.0f,
Real scale = 1.0f);
689 template <
typename T>
690 static T
Clamp(T val, T minval, T maxval)
692 assert (minval <= maxval &&
"Invalid clamp range");
693 return std::max(std::min(val, maxval), minval);
697 const Matrix4* reflectMatrix = 0);