Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Core/Math/Headers/MathHelper.h

Diff revisions: vs.
  @@ -26,23 +26,22 @@
26 26 Square root: http://www.codeproject.com/KB/cpp/Sqrt_Prec_VS_Speed.aspx
27 27 */
28 28
29 - #ifndef _MATH_HELPER_H_
30 - #define _MATH_HELPER_H_
29 + #ifndef _CORE_MATH_MATH_HELPER_H_
30 + #define _CORE_MATH_MATH_HELPER_H_
31 31
32 32 #include "Platform/DataTypes/Headers/PlatformDefines.h"
33 33 #include <sstream>
34 34 #include <cctype>
35 35 #include <algorithm>
36 36
37 - #ifndef M_PI
38 - #define M_PI 3.141592653589793238462643383279f // PI
39 - #endif
40 - #define M_PIDIV2 1.570796326794896619231321691639f // PI / 2
41 - #define M_2PI 6.283185307179586476925286766559f // 2 * PI
42 - #define M_PI2 9.869604401089358618834490999876f // PI ^ 2
43 - #define M_PIDIV180 0.01745329251994329576923690768488f // PI / 180
44 - #define M_180DIVPI 57.295779513082320876798154814105f // 180 / PI
45 - #define M_PIDIV360 0.00872664625997164788461845384244f // PI / 180 / 2 - PI / 360
37 + #undef M_PI
38 + #define M_PI 3.141592653589793238462643383279f // PI
39 + #define M_PIDIV2 1.570796326794896619231321691639f // PI / 2
40 + #define M_2PI 6.283185307179586476925286766559f // 2 * PI
41 + #define M_PI2 9.869604401089358618834490999876f // PI ^ 2
42 + #define M_PIDIV180 0.01745329251994329576923690768488f // PI / 180
43 + #define M_180DIVPI 57.295779513082320876798154814105f // 180 / PI
44 + #define M_PIDIV360 0.00872664625997164788461845384244f // PI / 180 / 2 - PI / 360
46 45
47 46 namespace Divide {
48 47
  @@ -51,13 +50,13 @@
51 50 template<typename T>
52 51 inline void RadToDeg(T& a) { a*=M_180DIVPI; }
53 52 template<typename T>
54 - inline F32 RADIANS(T a) { return a*M_PIDIV180;}
53 + inline F32 RADIANS(T a) { return a*M_PIDIV180;}
55 54 template<typename T>
56 - inline F32 DEGREES(T a) { return a*M_180DIVPI; }
55 + inline F32 DEGREES(T a) { return a*M_180DIVPI; }
57 56 template<typename T>
58 57 inline F32 kilometre(T a) { return a*1000.0f; }
59 58 template<typename T>
60 - inline F32 metre(T a) { return a*1.0f; }
59 + inline F32 metre(T a) { return a*1.0f; }
61 60 template<typename T>
62 61 inline F32 decimetre(T a) { return a*0.1f; }
63 62 template<typename T>
  @@ -339,7 +338,7 @@
339 338 template<typename T>
340 339 void decompose (const mat4<T>& matrix, vec3<T>& scale, Quaternion<T>& rotation, vec3<T>& position);
341 340 template<typename T>
342 - void decomposeNoScaling(const mat4<T>& matrix, Quaternion<T>& rotation, vec3<T>& position);
341 + void decomposeNoScaling(const mat4<T>& matrix, Quaternion<T>& rotation, vec3<T>& position);
343 342
344 343 template<typename T>
345 344 inline T* Multiply( const T *a, const T *b, T *r = nullptr ) {
  @@ -428,4 +427,4 @@
428 427
429 428 }; //namespace Divide
430 429
431 - #endif
430 + #endif //_CORE_MATH_MATH_HELPER_H_