summaryrefslogtreecommitdiff
path: root/scene/resources/capsule_shape_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/capsule_shape_2d.cpp')
-rw-r--r--scene/resources/capsule_shape_2d.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp
index 008e8bb13d..5658395cee 100644
--- a/scene/resources/capsule_shape_2d.cpp
+++ b/scene/resources/capsule_shape_2d.cpp
@@ -97,6 +97,10 @@ Rect2 CapsuleShape2D::get_rect() const {
return rect;
}
+real_t CapsuleShape2D::get_enclosing_radius() const {
+ return radius + height * 0.5;
+}
+
void CapsuleShape2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_radius", "radius"), &CapsuleShape2D::set_radius);