From 6f4f9aa6ded6da027c84cc466c767334dc3d3362 Mon Sep 17 00:00:00 2001 From: Ferenc Arn Date: Sat, 14 Jan 2017 14:35:39 -0600 Subject: Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions. --- core/math/rect3.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/math/rect3.cpp') diff --git a/core/math/rect3.cpp b/core/math/rect3.cpp index e0b0646505..d3f95b89e8 100644 --- a/core/math/rect3.cpp +++ b/core/math/rect3.cpp @@ -30,7 +30,7 @@ #include "print_string.h" -float Rect3::get_area() const { +real_t Rect3::get_area() const { return size.x*size.y*size.z; @@ -114,8 +114,8 @@ bool Rect3::intersects_ray(const Vector3& p_from, const Vector3& p_dir,Vector3* Vector3 c1, c2; Vector3 end = pos+size; - float near=-1e20; - float far=1e20; + real_t near=-1e20; + real_t far=1e20; int axis=0; for (int i=0;i<3;i++){ @@ -159,7 +159,7 @@ bool Rect3::intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector real_t min=0,max=1; int axis=0; - float sign=0; + real_t sign=0; for(int i=0;i<3;i++) { real_t seg_from=p_from[i]; @@ -167,7 +167,7 @@ bool Rect3::intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector real_t box_begin=pos[i]; real_t box_end=box_begin+size[i]; real_t cmin,cmax; - float csign; + real_t csign; if (seg_from < seg_to) { -- cgit v1.2.3