diff options
Diffstat (limited to 'core/math/aabb.cpp')
-rw-r--r-- | core/math/aabb.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index f5c667dab0..e868ebc7c8 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -31,6 +31,7 @@ #include "aabb.h" #include "core/print_string.h" +#include "core/variant.h" real_t AABB::get_area() const { return size.x * size.y * size.z; @@ -375,6 +376,21 @@ void AABB::get_edge(int p_edge, Vector3 &r_from, Vector3 &r_to) const { } } +Variant AABB::intersects_segment_bind(const Vector3 &p_from, const Vector3 &p_to) const { + Vector3 inters; + if (intersects_segment(p_from, p_to, &inters)) { + return inters; + } + return Variant(); +} +Variant AABB::intersects_ray_bind(const Vector3 &p_from, const Vector3 &p_dir) const { + Vector3 inters; + if (intersects_ray(p_from, p_dir, &inters)) { + return inters; + } + return Variant(); +} + AABB::operator String() const { return String() + position + " - " + size; } |