]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Quaternions.h
Force XYZ to initialize to please Valgrind.
[lugaru.git] / Source / Quaternions.h
index 872500c9ddd8371d4f413515fc7a1eb685c7f2f9..ec27e6e1a7456dd22affe67052b85ca4c8f19304 100644 (file)
@@ -8,8 +8,8 @@
 
 //#include "Carbon.h"
 #include "math.h"
-#include "Physicsmath.h"
-#include "gl.h"
+#include "PhysicsMath.h"
+#include "gamegl.h"
 
 /**> Quaternion Structures <**/
 #define PI      3.14159265355555897932384626
@@ -37,6 +37,7 @@ public:
        float x;
        float y;
        float z;
+    XYZ() : x(0.0f), y(0.0f), z(0.0f) {}
        inline XYZ operator+(XYZ add);
        inline XYZ operator-(XYZ add);
        inline XYZ operator*(float add);
@@ -207,9 +208,7 @@ inline void CrossProduct(XYZ P, XYZ Q, XYZ *V){
 
 inline float fast_sqrt (register float arg)
 {      
-#ifdef WIN32
-       return sqrtf( arg);
-#else
+#if PLATFORM_MACOSX
        // Can replace with slower return std::sqrt(arg);
        register float result;
 
@@ -224,6 +223,8 @@ inline float fast_sqrt (register float arg)
        result = result + 0.5 * result * (1.0 - arg * result * result);
 
        return result * arg;
+#else
+       return sqrtf( arg);
 #endif
 }
 
@@ -463,4 +464,4 @@ inline bool DistancePointLine( XYZ *Point, XYZ *LineStart, XYZ *LineEnd, float *
        return 1;
 }
 
-#endif
\ No newline at end of file
+#endif