From e6be3f68da4b88cb0c7d8c7464916235c73e1f92 Mon Sep 17 00:00:00 2001 From: Andrea Catania Date: Fri, 10 Jan 2020 12:22:34 +0100 Subject: - Integrated NavigationServer and Navigation2DServer. - Added Navigation Agents and Obstacles. - Integrated Collision Avoidance. This work has been kindly sponsored by IMVU. --- scene/resources/segment_shape_2d.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scene/resources/segment_shape_2d.cpp') diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 0070de72a2..3094d0f9bd 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -82,6 +82,10 @@ Rect2 SegmentShape2D::get_rect() const { return rect; } +real_t SegmentShape2D::get_enclosing_radius() const { + return (a + b).length(); +} + void SegmentShape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_a", "a"), &SegmentShape2D::set_a); @@ -138,6 +142,10 @@ Rect2 RayShape2D::get_rect() const { return rect; } +real_t RayShape2D::get_enclosing_radius() const { + return length; +} + void RayShape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_length", "length"), &RayShape2D::set_length); -- cgit v1.2.3