Permalink
Browse files

Make single precision default again, switching to double was a mistak…

…e. Sorry. :(
  • Loading branch information...
1 parent d8fb76c commit 9b7a42adc8e4fd788a66e5cd763e9a7a5809cc08 @Kazade committed Aug 23, 2012
Showing with 8 additions and 7 deletions.
  1. +1 −0 CMakeLists.txt
  2. +3 −3 kazmath/utility.h
  3. +4 −4 tests/test_mat3.cpp
View
@@ -5,6 +5,7 @@ PROJECT(kazmath)
ENABLE_TESTING()
SET(CMAKE_C_FLAGS "-std=c99")
+#ADD_DEFINITIONS("-DUSE_DOUBLE_PRECISION")
SET(KAZMATH_HEADERS
${CMAKE_SOURCE_DIR}/kazmath/vec2.h
View
@@ -29,10 +29,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <math.h>
#ifndef kmScalar
-#ifdef USE_SINGLE_PRECISION
-#define kmScalar float
-#else
+#ifdef USE_DOUBLE_PRECISION
#define kmScalar double
+#else
+#define kmScalar float
#endif
#endif
View
@@ -58,7 +58,7 @@ TEST(test_mat3_transpose) {
}
TEST(test_mat3_fill) {
- double temp[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+ kmScalar temp[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
kmMat3 orig, filled;
orig.mat[0] = 0.0f;
orig.mat[1] = 1.0f;
@@ -85,8 +85,8 @@ TEST(test_mat3_are_equal) {
}
TEST(test_mat3_axis_angle) {
- double radians = 1.0;
- double radiansOut;
+ kmScalar radians = 1.0;
+ kmScalar radiansOut;
kmMat3 a;
kmVec3 axisIn, axisOut;
kmVec3Fill(&axisIn, 1.0f, 0.0f, 0.0f);
@@ -104,7 +104,7 @@ TEST(test_mat3_axis_angle) {
}
TEST(test_mat3_identity) {
- double identity[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f };
+ kmScalar identity[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f };
kmMat3 expected, actual;
kmMat3Fill(&expected, identity);
kmMat3Identity(&actual);

1 comment on commit 9b7a42a

Contributor

Cloudef commented on 9b7a42a Dec 25, 2012

Thanks, this will simplify my stuff :)

Please sign in to comment.