Windows fix

This commit is contained in:
Jack Andersen 2015-10-12 09:24:53 -10:00
parent 070a8d7854
commit cd3d2ee133
2 changed files with 8 additions and 3 deletions

View File

@ -7,7 +7,7 @@
#ifndef _USE_MATH_DEFINES #ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES 1 #define _USE_MATH_DEFINES 1
#endif #endif
#include <cmath> #include <math.h>
#include <algorithm> #include <algorithm>
#include "CVector3f.hpp" #include "CVector3f.hpp"

View File

@ -46,8 +46,13 @@ double sqrtD(double val)
} }
double q; double q;
#if __SSE__ #if __SSE__
__m128d splat { val }; union
q = _mm_sqrt_pd(splat)[0]; {
__m128d v;
double d[2];
} qv = { val };
qv.v = _mm_sqrt_sd(qv.v, qv.v);
q = qv.d[0];
#else #else
// le sigh, let's use Carmack's inverse square -.- // le sigh, let's use Carmack's inverse square -.-
union union