diff options
Diffstat (limited to 'core/math/aabb.h')
-rw-r--r-- | core/math/aabb.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/math/aabb.h b/core/math/aabb.h index 9bbedfe59c..bd1f3a1a36 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -99,6 +99,10 @@ public: _FORCE_INLINE_ void project_range_in_plane(const Plane &p_plane, real_t &r_min, real_t &r_max) const; _FORCE_INLINE_ void expand_to(const Vector3 &p_vector); /** expand to contain a point if necessary */ + _FORCE_INLINE_ AABB abs() const { + return AABB(Vector3(position.x + MIN(size.x, 0), position.y + MIN(size.y, 0), position.z + MIN(size.z, 0)), size.abs()); + } + operator String() const; _FORCE_INLINE_ AABB() {} @@ -198,7 +202,7 @@ Vector3 AABB::get_endpoint(int p_point) const { return Vector3(position.x + size.x, position.y + size.y, position.z); case 7: return Vector3(position.x + size.x, position.y + size.y, position.z + size.z); - }; + } ERR_FAIL_V(Vector3()); } |