diff options
Diffstat (limited to 'core/math/aabb.cpp')
-rw-r--r-- | core/math/aabb.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index f5c667dab0..08673d0dd1 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -30,7 +30,8 @@ #include "aabb.h" -#include "core/print_string.h" +#include "core/string/print_string.h" +#include "core/variant/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; } |