summaryrefslogtreecommitdiffstats
path: root/core/math/rect3.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-20 19:24:49 -0300
committerGitHub <noreply@github.com>2017-01-20 19:24:49 -0300
commitee0f53df52d88ca57079579f3f3e943e7e40f53a (patch)
treefcf670f1e8aec411c6deaf97e9fc77bf5c195f31 /core/math/rect3.cpp
parent72a02555850016ab792cf498c5370983d3b72832 (diff)
parent6f4f9aa6ded6da027c84cc466c767334dc3d3362 (diff)
downloadredot-engine-ee0f53df52d88ca57079579f3f3e943e7e40f53a.tar.gz
Merge pull request #7528 from tagcup/real_t_float_fixes
Use real_t rather than float or double in generic functions (core/mat…
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) {