summaryrefslogtreecommitdiffstats
path: root/core/math/rect3.cpp
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2017-01-14 14:35:39 -0600
committerFerenc Arn <tagcup@yahoo.com>2017-01-16 13:36:33 -0600
commit6f4f9aa6ded6da027c84cc466c767334dc3d3362 (patch)
tree4d45d7e600a069d7feb2a2dae3a70d6b9ddbf884 /core/math/rect3.cpp
parentd13f2f9e25e380496e706b59720cd85eed299ca2 (diff)
downloadredot-engine-6f4f9aa6ded6da027c84cc466c767334dc3d3362.tar.gz
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.
Diffstat (limited to 'core/math/rect3.cpp')
-rw-r--r--core/math/rect3.cpp10
1 files changed, 5 insertions, 5 deletions
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) {