OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreMath.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __Math_H__
29 #define __Math_H__
30 
31 #include "OgrePrerequisites.h"
32 
33 namespace Ogre
34 {
46  class Radian
47  {
49 
50  public:
51  explicit Radian ( Real r=0 ) : mRad(r) {}
52  Radian ( const Degree& d );
53  Radian& operator = ( const Real& f ) { mRad = f; return *this; }
54  Radian& operator = ( const Radian& r ) { mRad = r.mRad; return *this; }
55  Radian& operator = ( const Degree& d );
56 
57  Real valueDegrees() const; // see bottom of this file
58  Real valueRadians() const { return mRad; }
59  Real valueAngleUnits() const;
60 
61  const Radian& operator + () const { return *this; }
62  Radian operator + ( const Radian& r ) const { return Radian ( mRad + r.mRad ); }
63  Radian operator + ( const Degree& d ) const;
64  Radian& operator += ( const Radian& r ) { mRad += r.mRad; return *this; }
65  Radian& operator += ( const Degree& d );
66  Radian operator - () const { return Radian(-mRad); }
67  Radian operator - ( const Radian& r ) const { return Radian ( mRad - r.mRad ); }
68  Radian operator - ( const Degree& d ) const;
69  Radian& operator -= ( const Radian& r ) { mRad -= r.mRad; return *this; }
70  Radian& operator -= ( const Degree& d );
71  Radian operator * ( Real f ) const { return Radian ( mRad * f ); }
72  Radian operator * ( const Radian& f ) const { return Radian ( mRad * f.mRad ); }
73  Radian& operator *= ( Real f ) { mRad *= f; return *this; }
74  Radian operator / ( Real f ) const { return Radian ( mRad / f ); }
75  Radian& operator /= ( Real f ) { mRad /= f; return *this; }
76 
77  bool operator < ( const Radian& r ) const { return mRad < r.mRad; }
78  bool operator <= ( const Radian& r ) const { return mRad <= r.mRad; }
79  bool operator == ( const Radian& r ) const { return mRad == r.mRad; }
80  bool operator != ( const Radian& r ) const { return mRad != r.mRad; }
81  bool operator >= ( const Radian& r ) const { return mRad >= r.mRad; }
82  bool operator > ( const Radian& r ) const { return mRad > r.mRad; }
83 
84  inline _OgreExport friend std::ostream& operator <<
85  ( std::ostream& o, const Radian& v )
86  {
87  o << "Radian(" << v.valueRadians() << ")";
88  return o;
89  }
90  };
91 
97  class Degree
98  {
99  Real mDeg; // if you get an error here - make sure to define/typedef 'Real' first
100 
101  public:
102  explicit Degree ( Real d=0 ) : mDeg(d) {}
103  Degree ( const Radian& r ) : mDeg(r.valueDegrees()) {}
104  Degree& operator = ( const Real& f ) { mDeg = f; return *this; }
105  Degree& operator = ( const Degree& d ) { mDeg = d.mDeg; return *this; }
106  Degree& operator = ( const Radian& r ) { mDeg = r.valueDegrees(); return *this; }
107 
108  Real valueDegrees() const { return mDeg; }
109  Real valueRadians() const; // see bottom of this file
110  Real valueAngleUnits() const;
111 
112  const Degree& operator + () const { return *this; }
113  Degree operator + ( const Degree& d ) const { return Degree ( mDeg + d.mDeg ); }
114  Degree operator + ( const Radian& r ) const { return Degree ( mDeg + r.valueDegrees() ); }
115  Degree& operator += ( const Degree& d ) { mDeg += d.mDeg; return *this; }
116  Degree& operator += ( const Radian& r ) { mDeg += r.valueDegrees(); return *this; }
117  Degree operator - () const { return Degree(-mDeg); }
118  Degree operator - ( const Degree& d ) const { return Degree ( mDeg - d.mDeg ); }
119  Degree operator - ( const Radian& r ) const { return Degree ( mDeg - r.valueDegrees() ); }
120  Degree& operator -= ( const Degree& d ) { mDeg -= d.mDeg; return *this; }
121  Degree& operator -= ( const Radian& r ) { mDeg -= r.valueDegrees(); return *this; }
122  Degree operator * ( Real f ) const { return Degree ( mDeg * f ); }
123  Degree operator * ( const Degree& f ) const { return Degree ( mDeg * f.mDeg ); }
124  Degree& operator *= ( Real f ) { mDeg *= f; return *this; }
125  Degree operator / ( Real f ) const { return Degree ( mDeg / f ); }
126  Degree& operator /= ( Real f ) { mDeg /= f; return *this; }
127 
128  bool operator < ( const Degree& d ) const { return mDeg < d.mDeg; }
129  bool operator <= ( const Degree& d ) const { return mDeg <= d.mDeg; }
130  bool operator == ( const Degree& d ) const { return mDeg == d.mDeg; }
131  bool operator != ( const Degree& d ) const { return mDeg != d.mDeg; }
132  bool operator >= ( const Degree& d ) const { return mDeg >= d.mDeg; }
133  bool operator > ( const Degree& d ) const { return mDeg > d.mDeg; }
134 
135  inline _OgreExport friend std::ostream& operator <<
136  ( std::ostream& o, const Degree& v )
137  {
138  o << "Degree(" << v.valueDegrees() << ")";
139  return o;
140  }
141  };
142 
149  class Angle
150  {
152  public:
153  explicit Angle ( Real angle ) : mAngle(angle) {}
154  operator Radian() const;
155  operator Degree() const;
156  };
157 
158  // these functions could not be defined within the class definition of class
159  // Radian because they required class Degree to be defined
160  inline Radian::Radian ( const Degree& d ) : mRad(d.valueRadians()) {
161  }
162  inline Radian& Radian::operator = ( const Degree& d ) {
163  mRad = d.valueRadians(); return *this;
164  }
165  inline Radian Radian::operator + ( const Degree& d ) const {
166  return Radian ( mRad + d.valueRadians() );
167  }
168  inline Radian& Radian::operator += ( const Degree& d ) {
169  mRad += d.valueRadians();
170  return *this;
171  }
172  inline Radian Radian::operator - ( const Degree& d ) const {
173  return Radian ( mRad - d.valueRadians() );
174  }
175  inline Radian& Radian::operator -= ( const Degree& d ) {
176  mRad -= d.valueRadians();
177  return *this;
178  }
179 
191  {
192  public:
199  {
201  AU_RADIAN
202  };
203 
204  protected:
205  // angle units used by the api
207 
209  static int mTrigTableSize;
210 
213  static Real* mSinTable;
214  static Real* mTanTable;
215 
218  void buildTrigTables();
219 
220  static Real SinTable (Real fValue);
221  static Real TanTable (Real fValue);
222  public:
228  Math(unsigned int trigTableSize = 4096);
229 
232  ~Math();
233 
234  static inline int IAbs (int iValue) { return ( iValue >= 0 ? iValue : -iValue ); }
235  static inline int ICeil (float fValue) { return int(ceil(fValue)); }
236  static inline int IFloor (float fValue) { return int(floor(fValue)); }
237  static int ISign (int iValue);
238 
243  static inline Real Abs (Real fValue) { return Real(fabs(fValue)); }
244 
249  static inline Degree Abs (const Degree& dValue) { return Degree(fabs(dValue.valueDegrees())); }
250 
255  static inline Radian Abs (const Radian& rValue) { return Radian(fabs(rValue.valueRadians())); }
256 
261  static Radian ACos (Real fValue);
262 
267  static Radian ASin (Real fValue);
268 
273  static inline Radian ATan (Real fValue) { return Radian(atan(fValue)); }
274 
281  static inline Radian ATan2 (Real fY, Real fX) { return Radian(atan2(fY,fX)); }
282 
289  static inline Real Ceil (Real fValue) { return Real(ceil(fValue)); }
290  static inline bool isNaN(Real f)
291  {
292  // std::isnan() is C99, not supported by all compilers
293  // However NaN always fails this next test, no other number does.
294  return f != f;
295  }
296 
304  static inline Real Cos (const Radian& fValue, bool useTables = false) {
305  return (!useTables) ? Real(cos(fValue.valueRadians())) : SinTable(fValue.valueRadians() + HALF_PI);
306  }
314  static inline Real Cos (Real fValue, bool useTables = false) {
315  return (!useTables) ? Real(cos(fValue)) : SinTable(fValue + HALF_PI);
316  }
317 
318  static inline Real Exp (Real fValue) { return Real(exp(fValue)); }
319 
326  static inline Real Floor (Real fValue) { return Real(floor(fValue)); }
327 
328  static inline Real Log (Real fValue) { return Real(log(fValue)); }
329 
331  static const Real LOG2;
332 
333  static inline Real Log2 (Real fValue) { return Real(log(fValue)/LOG2); }
334 
335  static inline Real LogN (Real base, Real fValue) { return Real(log(fValue)/log(base)); }
336 
337  static inline Real Pow (Real fBase, Real fExponent) { return Real(pow(fBase,fExponent)); }
338 
339  static Real Sign (Real fValue);
340  static inline Radian Sign ( const Radian& rValue )
341  {
342  return Radian(Sign(rValue.valueRadians()));
343  }
344  static inline Degree Sign ( const Degree& dValue )
345  {
346  return Degree(Sign(dValue.valueDegrees()));
347  }
348 
356  static inline Real Sin (const Radian& fValue, bool useTables = false) {
357  return (!useTables) ? Real(sin(fValue.valueRadians())) : SinTable(fValue.valueRadians());
358  }
366  static inline Real Sin (Real fValue, bool useTables = false) {
367  return (!useTables) ? Real(sin(fValue)) : SinTable(fValue);
368  }
369 
374  static inline Real Sqr (Real fValue) { return fValue*fValue; }
375 
380  static inline Real Sqrt (Real fValue) { return Real(sqrt(fValue)); }
381 
388  static inline Radian Sqrt (const Radian& fValue) { return Radian(sqrt(fValue.valueRadians())); }
389 
396  static inline Degree Sqrt (const Degree& fValue) { return Degree(sqrt(fValue.valueDegrees())); }
397 
403  static Real InvSqrt (Real fValue);
404 
409  static Real UnitRandom ();
410 
419  static Real RangeRandom (Real fLow, Real fHigh);
420 
425  static Real SymmetricRandom ();
426 
434  static inline Real Tan (const Radian& fValue, bool useTables = false) {
435  return (!useTables) ? Real(tan(fValue.valueRadians())) : TanTable(fValue.valueRadians());
436  }
444  static inline Real Tan (Real fValue, bool useTables = false) {
445  return (!useTables) ? Real(tan(fValue)) : TanTable(fValue);
446  }
447 
448  static inline Real DegreesToRadians(Real degrees) { return degrees * fDeg2Rad; }
449  static inline Real RadiansToDegrees(Real radians) { return radians * fRad2Deg; }
450 
457  static void setAngleUnit(AngleUnit unit);
459  static AngleUnit getAngleUnit(void);
460 
462  static Real AngleUnitsToRadians(Real units);
464  static Real RadiansToAngleUnits(Real radians);
466  static Real AngleUnitsToDegrees(Real units);
468  static Real DegreesToAngleUnits(Real degrees);
469 
491  static bool pointInTri2D(const Vector2& p, const Vector2& a,
492  const Vector2& b, const Vector2& c);
493 
518  static bool pointInTri3D(const Vector3& p, const Vector3& a,
519  const Vector3& b, const Vector3& c, const Vector3& normal);
521  static std::pair<bool, Real> intersects(const Ray& ray, const Plane& plane);
522 
524  static std::pair<bool, Real> intersects(const Ray& ray, const Sphere& sphere,
525  bool discardInside = true);
526 
528  static std::pair<bool, Real> intersects(const Ray& ray, const AxisAlignedBox& box);
529 
552  static bool intersects(const Ray& ray, const AxisAlignedBox& box,
553  Real* d1, Real* d2);
554 
579  static std::pair<bool, Real> intersects(const Ray& ray, const Vector3& a,
580  const Vector3& b, const Vector3& c, const Vector3& normal,
581  bool positiveSide = true, bool negativeSide = true);
582 
603  static std::pair<bool, Real> intersects(const Ray& ray, const Vector3& a,
604  const Vector3& b, const Vector3& c,
605  bool positiveSide = true, bool negativeSide = true);
606 
608  static bool intersects(const Sphere& sphere, const AxisAlignedBox& box);
609 
611  static bool intersects(const Plane& plane, const AxisAlignedBox& box);
612 
618  static std::pair<bool, Real> intersects(
619  const Ray& ray, const vector<Plane>::type& planeList,
620  bool normalIsOutside);
626  static std::pair<bool, Real> intersects(
627  const Ray& ray, const list<Plane>::type& planeList,
628  bool normalIsOutside);
629 
633  static bool intersects(const Sphere& sphere, const Plane& plane);
634 
637  static bool RealEqual(Real a, Real b,
638  Real tolerance = std::numeric_limits<Real>::epsilon());
639 
641  static Vector3 calculateTangentSpaceVector(
642  const Vector3& position1, const Vector3& position2, const Vector3& position3,
643  Real u1, Real v1, Real u2, Real v2, Real u3, Real v3);
644 
646  static Matrix4 buildReflectionMatrix(const Plane& p);
648  static Vector4 calculateFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3);
650  static Vector3 calculateBasicFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3);
652  static Vector4 calculateFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3);
654  static Vector3 calculateBasicFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3);
655 
659  static Real gaussianDistribution(Real x, Real offset = 0.0f, Real scale = 1.0f);
660 
662  template <typename T>
663  static T Clamp(T val, T minval, T maxval)
664  {
665  assert (minval <= maxval && "Invalid clamp range");
666  return std::max(std::min(val, maxval), minval);
667  }
668 
669  static Matrix4 makeViewMatrix(const Vector3& position, const Quaternion& orientation,
670  const Matrix4* reflectMatrix = 0);
671 
673  static Real boundingRadiusFromAABB(const AxisAlignedBox& aabb);
674 
675 
676 
677  static const Real POS_INFINITY;
678  static const Real NEG_INFINITY;
679  static const Real PI;
680  static const Real TWO_PI;
681  static const Real HALF_PI;
682  static const Real fDeg2Rad;
683  static const Real fRad2Deg;
684 
685  };
686 
687  // these functions must be defined down here, because they rely on the
688  // angle unit conversion functions in class Math:
689 
690  inline Real Radian::valueDegrees() const
691  {
692  return Math::RadiansToDegrees ( mRad );
693  }
694 
696  {
697  return Math::RadiansToAngleUnits ( mRad );
698  }
699 
700  inline Real Degree::valueRadians() const
701  {
702  return Math::DegreesToRadians ( mDeg );
703  }
704 
706  {
707  return Math::DegreesToAngleUnits ( mDeg );
708  }
709 
710  inline Angle::operator Radian() const
711  {
712  return Radian(Math::AngleUnitsToRadians(mAngle));
713  }
714 
715  inline Angle::operator Degree() const
716  {
717  return Degree(Math::AngleUnitsToDegrees(mAngle));
718  }
719 
720  inline Radian operator * ( Real a, const Radian& b )
721  {
722  return Radian ( a * b.valueRadians() );
723  }
724 
725  inline Radian operator / ( Real a, const Radian& b )
726  {
727  return Radian ( a / b.valueRadians() );
728  }
729 
730  inline Degree operator * ( Real a, const Degree& b )
731  {
732  return Degree ( a * b.valueDegrees() );
733  }
734 
735  inline Degree operator / ( Real a, const Degree& b )
736  {
737  return Degree ( a / b.valueDegrees() );
738  }
742 }
743 #endif
Representation of a ray in space, i.e.
Definition: OgreRay.h:46
Radian & operator+=(const Radian &r)
Definition: OgreMath.h:64
static Real LogN(Real base, Real fValue)
Definition: OgreMath.h:335
static Radian Sign(const Radian &rValue)
Definition: OgreMath.h:340
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Degree & operator+=(const Degree &d)
Definition: OgreMath.h:115
float Real
Software floating point type.
static const Real LOG2
Stored value of log(2) for frequent use.
Definition: OgreMath.h:331
static const Real HALF_PI
Definition: OgreMath.h:681
#define _OgreExport
Definition: OgrePlatform.h:233
static T Clamp(T val, T minval, T maxval)
Clamp a value within an inclusive range.
Definition: OgreMath.h:663
static Degree Abs(const Degree &dValue)
Absolute value function.
Definition: OgreMath.h:249
AngleUnit
The angular units used by the API.
Definition: OgreMath.h:198
static Real Log(Real fValue)
Definition: OgreMath.h:328
static const Real fDeg2Rad
Definition: OgreMath.h:682
static Real Cos(Real fValue, bool useTables=false)
Cosine function.
Definition: OgreMath.h:314
Defines a plane in 3D space.
Definition: OgrePlane.h:61
Degree & operator=(const Real &f)
Definition: OgreMath.h:104
static Radian ATan(Real fValue)
Arc tangent function.
Definition: OgreMath.h:273
bool operator<=(const Radian &r) const
Definition: OgreMath.h:78
Real valueRadians() const
Definition: OgreMath.h:700
static Real RadiansToAngleUnits(Real radians)
Convert from radians to the current AngleUnit .
static Radian Sqrt(const Radian &fValue)
Square root function.
Definition: OgreMath.h:388
static Radian Abs(const Radian &rValue)
Absolute value function.
Definition: OgreMath.h:255
Real mRad
Definition: OgreMath.h:48
static Real Exp(Real fValue)
Definition: OgreMath.h:318
static Real Log2(Real fValue)
Definition: OgreMath.h:333
bool operator<(const Degree &d) const
Definition: OgreMath.h:128
Wrapper class which identifies a value as the currently default angle type, as defined by Math::setAn...
Definition: OgreMath.h:149
static const Real TWO_PI
Definition: OgreMath.h:680
A 3D box aligned with the x/y/z axes.
Radian & operator/=(Real f)
Definition: OgreMath.h:75
std::list< T, A > type
bool operator!=(const Degree &d) const
Definition: OgreMath.h:131
static Real Tan(Real fValue, bool useTables=false)
Tangent function.
Definition: OgreMath.h:444
Class to provide access to common mathematical functions.
Definition: OgreMath.h:190
Degree & operator/=(Real f)
Definition: OgreMath.h:126
bool operator>(const Radian &r) const
Definition: OgreMath.h:82
bool operator!=(const Radian &r) const
Definition: OgreMath.h:80
Radian & operator-=(const Radian &r)
Definition: OgreMath.h:69
static Real Cos(const Radian &fValue, bool useTables=false)
Cosine function.
Definition: OgreMath.h:304
Radian operator*(Real a, const Radian &b)
Definition: OgreMath.h:720
Radian operator/(Real a, const Radian &b)
Definition: OgreMath.h:725
Implementation of a Quaternion, i.e.
Angle(Real angle)
Definition: OgreMath.h:153
Radian operator/(Real f) const
Definition: OgreMath.h:74
static const Real POS_INFINITY
Definition: OgreMath.h:677
Degree & operator*=(Real f)
Definition: OgreMath.h:124
Real valueAngleUnits() const
Definition: OgreMath.h:705
static const Real PI
Definition: OgreMath.h:679
static Real Tan(const Radian &fValue, bool useTables=false)
Tangent function.
Definition: OgreMath.h:434
static Real Sin(Real fValue, bool useTables=false)
Sine function.
Definition: OgreMath.h:366
static Real AngleUnitsToDegrees(Real units)
Convert from the current AngleUnit to degrees.
static Real DegreesToRadians(Real degrees)
Definition: OgreMath.h:448
static Real * mTanTable
Definition: OgreMath.h:214
static Real Abs(Real fValue)
Absolute value function.
Definition: OgreMath.h:243
Degree & operator-=(const Degree &d)
Definition: OgreMath.h:120
static Real mTrigTableFactor
Radian -> index factor value ( mTrigTableSize / 2 * PI )
Definition: OgreMath.h:212
static Radian ATan2(Real fY, Real fX)
Arc tangent between two values function.
Definition: OgreMath.h:281
static Real Sin(const Radian &fValue, bool useTables=false)
Sine function.
Definition: OgreMath.h:356
bool operator>=(const Degree &d) const
Definition: OgreMath.h:132
Degree(const Radian &r)
Definition: OgreMath.h:103
static Real Sqrt(Real fValue)
Square root function.
Definition: OgreMath.h:380
static Real Ceil(Real fValue)
Ceiling function Returns the smallest following integer.
Definition: OgreMath.h:289
A sphere primitive, mostly used for bounds checking.
Definition: OgreSphere.h:51
static Real AngleUnitsToRadians(Real units)
Convert from the current AngleUnit to radians.
Standard 2-dimensional vector.
Definition: OgreVector2.h:51
static Real Floor(Real fValue)
Floor function Returns the largest previous integer.
Definition: OgreMath.h:326
Wrapper class which indicates a given angle value is in Degrees.
Definition: OgreMath.h:97
static int IAbs(int iValue)
Definition: OgreMath.h:234
static Degree Sqrt(const Degree &fValue)
Square root function.
Definition: OgreMath.h:396
Degree operator/(Real f) const
Definition: OgreMath.h:125
static Real Sqr(Real fValue)
Squared function.
Definition: OgreMath.h:374
Real valueRadians() const
Definition: OgreMath.h:58
static int mTrigTableSize
Size of the trig tables as determined by constructor.
Definition: OgreMath.h:209
Degree operator*(Real f) const
Definition: OgreMath.h:122
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
static Real Pow(Real fBase, Real fExponent)
Definition: OgreMath.h:337
static AngleUnit msAngleUnit
Definition: OgreMath.h:206
Degree(Real d=0)
Definition: OgreMath.h:102
static int IFloor(float fValue)
Definition: OgreMath.h:236
Radian & operator=(const Real &f)
Definition: OgreMath.h:53
bool operator<(const Radian &r) const
Definition: OgreMath.h:77
static const Real NEG_INFINITY
Definition: OgreMath.h:678
static Real * mSinTable
Definition: OgreMath.h:213
static Real DegreesToAngleUnits(Real degrees)
Convert from degrees to the current AngleUnit.
const Degree & operator+() const
Definition: OgreMath.h:112
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:46
const Radian & operator+() const
Definition: OgreMath.h:61
static int ICeil(float fValue)
Definition: OgreMath.h:235
bool operator==(const Degree &d) const
Definition: OgreMath.h:130
bool operator>=(const Radian &r) const
Definition: OgreMath.h:81
Real mDeg
Definition: OgreMath.h:99
Real valueDegrees() const
Definition: OgreMath.h:690
static bool isNaN(Real f)
Definition: OgreMath.h:290
bool operator>(const Degree &d) const
Definition: OgreMath.h:133
Radian & operator*=(Real f)
Definition: OgreMath.h:73
4-dimensional homogeneous vector.
Definition: OgreVector4.h:45
static Real RadiansToDegrees(Real radians)
Definition: OgreMath.h:449
bool operator==(const Radian &r) const
Definition: OgreMath.h:79
bool operator<=(const Degree &d) const
Definition: OgreMath.h:129
Real mAngle
Definition: OgreMath.h:151
Radian operator-() const
Definition: OgreMath.h:66
Radian operator*(Real f) const
Definition: OgreMath.h:71
Real valueAngleUnits() const
Definition: OgreMath.h:695
Degree operator-() const
Definition: OgreMath.h:117
Radian(Real r=0)
Definition: OgreMath.h:51
static const Real fRad2Deg
Definition: OgreMath.h:683
Real valueDegrees() const
Definition: OgreMath.h:108
static Degree Sign(const Degree &dValue)
Definition: OgreMath.h:344