summaryrefslogtreecommitdiff
path: root/core/math/aabb.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/aabb.h')
-rw-r--r--core/math/aabb.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/math/aabb.h b/core/math/aabb.h
index 0fada859c0..57fe1b32f5 100644
--- a/core/math/aabb.h
+++ b/core/math/aabb.h
@@ -47,21 +47,21 @@ public:
float get_area() const; /// get area
_FORCE_INLINE_ bool has_no_area() const {
-
+
return (size.x<=CMP_EPSILON || size.y<=CMP_EPSILON || size.z<=CMP_EPSILON);
}
_FORCE_INLINE_ bool has_no_surface() const {
-
+
return (size.x<=CMP_EPSILON && size.y<=CMP_EPSILON && size.z<=CMP_EPSILON);
}
-
+
const Vector3& get_pos() const { return pos; }
void set_pos(const Vector3& p_pos) { pos=p_pos; }
const Vector3& get_size() const { return size; }
void set_size(const Vector3& p_size) { size=p_size; }
-
+
bool operator==(const AABB& p_rval) const;
bool operator!=(const AABB& p_rval) const;
@@ -265,7 +265,7 @@ bool AABB::has_point(const Vector3& p_point) const {
return false;
if (p_point.z>pos.z+size.z)
return false;
-
+
return true;
}
@@ -297,11 +297,11 @@ void AABB::project_range_in_plane(const Plane& p_plane,float &r_min,float& r_max
Vector3 half_extents( size.x * 0.5, size.y * 0.5, size.z * 0.5 );
Vector3 center( pos.x + half_extents.x, pos.y + half_extents.y, pos.z + half_extents.z );
-
+
float length = p_plane.normal.abs().dot(half_extents);
float distance = p_plane.distance_to( center );
r_min = distance - length;
- r_max = distance + length;
+ r_max = distance + length;
}
inline real_t AABB::get_longest_axis_size() const {