]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/mathlib.h
Merge branch 'master' into master-merge
[xonotic/netradiant.git] / libs / mathlib.h
index 64f3f6e43d8db5e2019fc4410d859483fbd20f73..8ed115d606d7973d6c16bb692974b5c57ad6a956 100644 (file)
@@ -101,7 +101,20 @@ void _CrossProduct( vec3_t v1, vec3_t v2, vec3_t cross );
 // I need this define in order to test some of the regression tests from time to time.
 // This define affect the precision of VectorNormalize() function only.
 #define MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX 1
-vec_t VectorNormalize( const vec3_t in, vec3_t out );
+vec_t VectorAccurateNormalize( const vec3_t in, vec3_t out );
+vec_t VectorFastNormalize_( const vec3_t in, vec3_t out );
+#if MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX
+#define VectorNormalize VectorAccurateNormalize
+#else
+#define VectorNormalize VectorFastNormalize_
+#endif
+
+#if 0 //use fastnormalize in a few -light spots
+       #define VectorFastNormalize VectorFastNormalize_
+#else
+       #define VectorFastNormalize VectorNormalize
+#endif
+
 vec_t ColorNormalize( const vec3_t in, vec3_t out );
 void VectorInverse( vec3_t v );
 void VectorPolar( vec3_t v, float radius, float theta, float phi );