summaryrefslogtreecommitdiff
path: root/core/math/aabb.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-04-24 16:08:05 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-04-24 16:08:05 -0300
commit7006fe3cc4580b2ece75681c0adc1ab6ab27891a (patch)
tree2ae9b2079ae0c252e270bc058cc2c473c8dc8ef3 /core/math/aabb.h
parent4fb905ed29357a57933f796b1478a4f874b83c05 (diff)
Corrected rectangle intersection, fixes #1731
Diffstat (limited to 'core/math/aabb.h')
-rw-r--r--core/math/aabb.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/math/aabb.h b/core/math/aabb.h
index 5ce39c34d7..4781e5c263 100644
--- a/core/math/aabb.h
+++ b/core/math/aabb.h
@@ -110,17 +110,17 @@ public:
inline bool AABB::intersects(const AABB& p_aabb) const {
- if ( pos.x > (p_aabb.pos.x + p_aabb.size.x) )
+ if ( pos.x >= (p_aabb.pos.x + p_aabb.size.x) )
return false;
- if ( (pos.x+size.x) < p_aabb.pos.x )
+ if ( (pos.x+size.x) <= p_aabb.pos.x )
return false;
- if ( pos.y > (p_aabb.pos.y + p_aabb.size.y) )
+ if ( pos.y >= (p_aabb.pos.y + p_aabb.size.y) )
return false;
- if ( (pos.y+size.y) < p_aabb.pos.y )
+ if ( (pos.y+size.y) <= p_aabb.pos.y )
return false;
- if ( pos.z > (p_aabb.pos.z + p_aabb.size.z) )
+ if ( pos.z >= (p_aabb.pos.z + p_aabb.size.z) )
return false;
- if ( (pos.z+size.z) < p_aabb.pos.z )
+ if ( (pos.z+size.z) <= p_aabb.pos.z )
return false;
return true;