summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorOvnuniarchos <pujalte.jorge@gmail.com>2015-11-18 19:20:50 +0100
committerOvnuniarchos <pujalte.jorge@gmail.com>2015-11-18 19:20:50 +0100
commit0b05739a8ba7b0181f7f596a4813058ba3a0cb3b (patch)
tree886a2d79b939e9d1365a90a1b3faa1dae8e40d56 /scene/resources
parentb08312b30c5fa47bffc2d21d4cb57520b822bf45 (diff)
*Polygon2D now updates on any modification in its point array. ShapeLine2D has now an editor.
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/concave_polygon_shape_2d.cpp1
-rw-r--r--scene/resources/convex_polygon_shape_2d.cpp3
-rw-r--r--scene/resources/shape_line_2d.cpp1
3 files changed, 4 insertions, 1 deletions
diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp
index 923e2817ef..01b7531f14 100644
--- a/scene/resources/concave_polygon_shape_2d.cpp
+++ b/scene/resources/concave_polygon_shape_2d.cpp
@@ -34,6 +34,7 @@
void ConcavePolygonShape2D::set_segments(const DVector<Vector2>& p_segments) {
Physics2DServer::get_singleton()->shape_set_data(get_rid(),p_segments);
+ emit_changed();
}
DVector<Vector2> ConcavePolygonShape2D::get_segments() const {
diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp
index dac39fc846..a1137ba614 100644
--- a/scene/resources/convex_polygon_shape_2d.cpp
+++ b/scene/resources/convex_polygon_shape_2d.cpp
@@ -33,6 +33,7 @@
void ConvexPolygonShape2D::_update_shape() {
Physics2DServer::get_singleton()->shape_set_data(get_rid(),points);
+ emit_changed();
}
@@ -62,7 +63,7 @@ void ConvexPolygonShape2D::_bind_methods() {
- ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"points"),_SCS("set_points"),_SCS("get_points") );
+ ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"points"),_SCS("set_points"),_SCS("get_points") );
}
diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp
index c660b604f3..97e9985754 100644
--- a/scene/resources/shape_line_2d.cpp
+++ b/scene/resources/shape_line_2d.cpp
@@ -35,6 +35,7 @@ void LineShape2D::_update_shape() {
arr.push_back(normal);
arr.push_back(d);
Physics2DServer::get_singleton()->shape_set_data(get_rid(),arr);
+ emit_changed();
}