summaryrefslogtreecommitdiff
path: root/scene/resources/line_shape_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/line_shape_2d.cpp')
-rw-r--r--scene/resources/line_shape_2d.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/resources/line_shape_2d.cpp b/scene/resources/line_shape_2d.cpp
index 7f39467403..3b30b4528a 100644
--- a/scene/resources/line_shape_2d.cpp
+++ b/scene/resources/line_shape_2d.cpp
@@ -100,6 +100,10 @@ Rect2 LineShape2D::get_rect() const {
return rect;
}
+real_t LineShape2D::get_enclosing_radius() const {
+ return d;
+}
+
void LineShape2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_normal", "normal"), &LineShape2D::set_normal);
@@ -109,13 +113,13 @@ void LineShape2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_d"), &LineShape2D::get_d);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "normal"), "set_normal", "get_normal");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "d"), "set_d", "get_d");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "d"), "set_d", "get_d");
}
LineShape2D::LineShape2D() :
Shape2D(Physics2DServer::get_singleton()->line_shape_create()) {
- normal = Vector2(0, -1);
+ normal = Vector2(0, 1);
d = 0;
_update_shape();
}