#include <OgreMath.h>
Public Types | |
enum | AngleUnit { AU_DEGREE, AU_RADIAN } |
The angular units used by the API. More... | |
Public Member Functions | |
Math (unsigned int trigTableSize=4096) | |
Default constructor. | |
~Math () | |
Default destructor. | |
Static Public Member Functions | |
int | IAbs (int iValue) |
int | ICeil (float fValue) |
int | IFloor (float fValue) |
int | ISign (int iValue) |
Real | Abs (Real fValue) |
Degree | Abs (const Degree &dValue) |
Radian | Abs (const Radian &rValue) |
Radian | ACos (Real fValue) |
Radian | ASin (Real fValue) |
Radian | ATan (Real fValue) |
Radian | ATan2 (Real fY, Real fX) |
Real | Ceil (Real fValue) |
Real | Cos (const Radian &fValue, bool useTables=false) |
Cosine function. | |
Real | Cos (Real fValue, bool useTables=false) |
Cosine function. | |
Real | Exp (Real fValue) |
Real | Floor (Real fValue) |
Real | Log (Real fValue) |
Real | Pow (Real fBase, Real fExponent) |
Real | Sign (Real fValue) |
Radian | Sign (const Radian &rValue) |
Degree | Sign (const Degree &dValue) |
Real | Sin (const Radian &fValue, bool useTables=false) |
Sine function. | |
Real | Sin (Real fValue, bool useTables=false) |
Sine function. | |
Real | Sqr (Real fValue) |
Real | Sqrt (Real fValue) |
Radian | Sqrt (const Radian &fValue) |
Degree | Sqrt (const Degree &fValue) |
Real | InvSqrt (Real fValue) |
Inverse square root i.e. | |
Real | UnitRandom () |
Real | RangeRandom (Real fLow, Real fHigh) |
Real | SymmetricRandom () |
Real | Tan (const Radian &fValue, bool useTables=false) |
Tangent function. | |
Real | Tan (Real fValue, bool useTables=false) |
Tangent function. | |
Real | DegreesToRadians (Real degrees) |
Real | RadiansToDegrees (Real radians) |
void | setAngleUnit (AngleUnit unit) |
These functions used to set the assumed angle units (radians or degrees) expected when using the Angle type. | |
AngleUnit | getAngleUnit (void) |
Get the unit being used for angles. | |
Real | AngleUnitsToRadians (Real units) |
Convert from the current AngleUnit to radians. | |
Real | RadiansToAngleUnits (Real radians) |
Convert from radians to the current AngleUnit . | |
Real | AngleUnitsToDegrees (Real units) |
Convert from the current AngleUnit to degrees. | |
Real | DegreesToAngleUnits (Real degrees) |
Convert from degrees to the current AngleUnit. | |
bool | pointInTri2D (const Vector2 &p, const Vector2 &a, const Vector2 &b, const Vector2 &c) |
Checks whether a given point is inside a triangle, in a 2-dimensional (Cartesian) space. | |
bool | pointInTri3D (const Vector3 &p, const Vector3 &a, const Vector3 &b, const Vector3 &c, const Vector3 &normal) |
Checks whether a given 3D point is inside a triangle. | |
std::pair< bool, Real > | intersects (const Ray &ray, const Plane &plane) |
Ray / plane intersection, returns boolean result and distance. | |
std::pair< bool, Real > | intersects (const Ray &ray, const Sphere &sphere, bool discardInside=true) |
Ray / sphere intersection, returns boolean result and distance. | |
std::pair< bool, Real > | intersects (const Ray &ray, const AxisAlignedBox &box) |
Ray / box intersection, returns boolean result and distance. | |
bool | intersects (const Ray &ray, const AxisAlignedBox &box, Real *d1, Real *d2) |
Ray / box intersection, returns boolean result and two intersection distance. | |
std::pair< bool, Real > | intersects (const Ray &ray, const Vector3 &a, const Vector3 &b, const Vector3 &c, const Vector3 &normal, bool positiveSide=true, bool negativeSide=true) |
Ray / triangle intersection, returns boolean result and distance. | |
std::pair< bool, Real > | intersects (const Ray &ray, const Vector3 &a, const Vector3 &b, const Vector3 &c, bool positiveSide=true, bool negativeSide=true) |
Ray / triangle intersection, returns boolean result and distance. | |
bool | intersects (const Sphere &sphere, const AxisAlignedBox &box) |
Sphere / box intersection test. | |
bool | intersects (const Plane &plane, const AxisAlignedBox &box) |
Plane / box intersection test. | |
std::pair< bool, Real > | intersects (const Ray &ray, const std::vector< Plane > &planeList, bool normalIsOutside) |
Ray / convex plane list intersection test. | |
std::pair< bool, Real > | intersects (const Ray &ray, const std::list< Plane > &planeList, bool normalIsOutside) |
Ray / convex plane list intersection test. | |
bool | intersects (const Sphere &sphere, const Plane &plane) |
Sphere / plane intersection test. | |
bool | RealEqual (Real a, Real b, Real tolerance=std::numeric_limits< Real >::epsilon()) |
Compare 2 reals, using tolerance for inaccuracies. | |
Vector3 | calculateTangentSpaceVector (const Vector3 &position1, const Vector3 &position2, const Vector3 &position3, Real u1, Real v1, Real u2, Real v2, Real u3, Real v3) |
Calculates the tangent space vector for a given set of positions / texture coords. | |
Matrix4 | buildReflectionMatrix (const Plane &p) |
Build a reflection matrix for the passed in plane. | |
Vector4 | calculateFaceNormal (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3) |
Calculate a face normal, including the w component which is the offset from the origin. | |
Vector3 | calculateBasicFaceNormal (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3) |
Calculate a face normal, no w-information. | |
Vector4 | calculateFaceNormalWithoutNormalize (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3) |
Calculate a face normal without normalize, including the w component which is the offset from the origin. | |
Vector3 | calculateBasicFaceNormalWithoutNormalize (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3) |
Calculate a face normal without normalize, no w-information. | |
Static Public Attributes | |
const Real | POS_INFINITY |
const Real | NEG_INFINITY |
const Real | PI |
const Real | TWO_PI |
const Real | HALF_PI |
const Real | fDeg2Rad |
const Real | fRad2Deg |
Protected Member Functions | |
void | buildTrigTables () |
Private function to build trig tables. | |
Static Protected Member Functions | |
Real | SinTable (Real fValue) |
Real | TanTable (Real fValue) |
Static Protected Attributes | |
AngleUnit | msAngleUnit |
int | mTrigTableSize |
Size of the trig tables as determined by constructor. | |
Real | mTrigTableFactor |
Radian -> index factor value ( mTrigTableSize / 2 * PI ). | |
Real * | mSinTable |
Real * | mTanTable |
Definition at line 165 of file OgreMath.h.
|
The angular units used by the API. This functionality is now deprecated in favor of discreet angular unit types ( see Degree and Radian above ). The only place this functionality is actually still used is when parsing files. Search for usage of the Angle class for those instances Definition at line 173 of file OgreMath.h. |
|
Default constructor.
|
|
Default destructor.
|
|
Definition at line 216 of file OgreMath.h. References Ogre::Radian::valueRadians(). |
|
Definition at line 215 of file OgreMath.h. References Ogre::Degree::valueDegrees(). |
|
Definition at line 214 of file OgreMath.h. References Ogre::Real. |
|
|
|
Convert from the current AngleUnit to degrees.
|
|
Convert from the current AngleUnit to radians.
|
|
|
|
Definition at line 219 of file OgreMath.h. References Ogre::Real. |
|
Definition at line 220 of file OgreMath.h. References Ogre::Real. |
|
Build a reflection matrix for the passed in plane.
|
|
Private function to build trig tables.
|
|
Calculate a face normal, no w-information.
|
|
Calculate a face normal without normalize, no w-information.
|
|
Calculate a face normal, including the w component which is the offset from the origin.
|
|
Calculate a face normal without normalize, including the w component which is the offset from the origin.
|
|
Calculates the tangent space vector for a given set of positions / texture coords.
|
|
Definition at line 221 of file OgreMath.h. References Ogre::Real. |
|
Cosine function.
Definition at line 240 of file OgreMath.h. References Ogre::Real. |
|
Cosine function.
Definition at line 230 of file OgreMath.h. References Ogre::Real, and Ogre::Radian::valueRadians(). |
|
Convert from degrees to the current AngleUnit.
|
|
Definition at line 323 of file OgreMath.h. References Ogre::Real. |
|
Definition at line 244 of file OgreMath.h. References Ogre::Real. |
|
Definition at line 246 of file OgreMath.h. References Ogre::Real. |
|
Get the unit being used for angles.
|
|
Definition at line 209 of file OgreMath.h. |
|
Definition at line 210 of file OgreMath.h. |
|
Definition at line 211 of file OgreMath.h. |
|
Sphere / plane intersection test.
|
|
Ray / convex plane list intersection test.
|
|
Ray / convex plane list intersection test.
|
|
Plane / box intersection test.
|
|
Sphere / box intersection test.
|
|
Ray / triangle intersection, returns boolean result and distance.
|
|
Ray / triangle intersection, returns boolean result and distance.
|
|
Ray / box intersection, returns boolean result and two intersection distance.
|
|
Ray / box intersection, returns boolean result and distance.
|
|
Ray / sphere intersection, returns boolean result and distance.
|
|
Ray / plane intersection, returns boolean result and distance.
|
|
Inverse square root i.e. 1 / Sqrt(x), good for vector normalisation. |
|
|
|
Definition at line 248 of file OgreMath.h. References Ogre::Real. |
|
Checks whether a given point is inside a triangle, in a 2-dimensional (Cartesian) space.
|
|
Checks whether a given 3D point is inside a triangle.
|
|
Definition at line 250 of file OgreMath.h. References Ogre::Real. |
|
Convert from radians to the current AngleUnit .
|
|
Definition at line 324 of file OgreMath.h. References Ogre::Real. |
|
|
|
Compare 2 reals, using tolerance for inaccuracies.
|
|
These functions used to set the assumed angle units (radians or degrees) expected when using the Angle type.
|
|
Definition at line 257 of file OgreMath.h. References Ogre::Degree::valueDegrees(). |
|
Definition at line 253 of file OgreMath.h. References Ogre::Radian::valueRadians(). |
|
|
|
Sine function.
Definition at line 279 of file OgreMath.h. References Ogre::Real. |
|
Sine function.
Definition at line 269 of file OgreMath.h. References Ogre::Real, and Ogre::Radian::valueRadians(). |
|
|
|
Definition at line 283 of file OgreMath.h. References Ogre::Real. |
|
Definition at line 289 of file OgreMath.h. References Ogre::Degree::valueDegrees(). |
|
Definition at line 287 of file OgreMath.h. References Ogre::Radian::valueRadians(). |
|
Definition at line 285 of file OgreMath.h. References Ogre::Real. |
|
|
|
Tangent function.
Definition at line 319 of file OgreMath.h. References Ogre::Real. |
|
Tangent function.
Definition at line 309 of file OgreMath.h. References Ogre::Real, and Ogre::Radian::valueRadians(). |
|
|
|
|
|
Definition at line 536 of file OgreMath.h. |
|
Definition at line 537 of file OgreMath.h. |
|
Definition at line 535 of file OgreMath.h. |
|
Definition at line 181 of file OgreMath.h. |
|
Definition at line 188 of file OgreMath.h. |
|
Definition at line 189 of file OgreMath.h. |
|
Radian -> index factor value ( mTrigTableSize / 2 * PI ).
Definition at line 187 of file OgreMath.h. |
|
Size of the trig tables as determined by constructor.
Definition at line 184 of file OgreMath.h. |
|
Definition at line 532 of file OgreMath.h. |
|
Definition at line 533 of file OgreMath.h. |
|
Definition at line 531 of file OgreMath.h. |
|
Definition at line 534 of file OgreMath.h. |
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:40:01 2006