diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-10 16:25:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 16:25:21 +0100 |
commit | 2dd73b1ffad10824a9f66e3ac04f4e2a7d51a85e (patch) | |
tree | 683288f29c949e731bcc34c62212ed7f184ba76a /scene/resources/segment_shape_2d.cpp | |
parent | 1dd0eb4f339a9f0ae78077aaac3dafeafdf78279 (diff) | |
parent | 383c583a0b46b36ab9b0de57d0f3f7bdecb62fc8 (diff) |
Merge pull request #34776 from AndreaCatania/nav_pr
Integrated the new `NavigationServer` and `NavigationServer2D`
Diffstat (limited to 'scene/resources/segment_shape_2d.cpp')
-rw-r--r-- | scene/resources/segment_shape_2d.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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); |