diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-23 23:30:43 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-06-23 23:39:52 -0300 |
commit | 6ba1e4677ba15992c750bddffcb9f1eacd1558a1 (patch) | |
tree | 78e6c53f5279a76fc589544ad3c241c2648af66b /editor/plugins | |
parent | 683f50bef476fbe630f893876e709ad03348b2c3 (diff) |
-Trigger shapes removed in 2D, they became obsolete long ago when areas could detect their own overlap
-Added ability to disable individual collisionshape/polygon
-Moved One Way Collision to shape, allowing more flexibility
-Changed internals of CollisionObject, shapes are generated from child nodes on the fly, not stored inside any longer.
-Modifying a CollisionPolygon2D on the fly now works, it can even be animated.
Will port this to 3D once well tested. Have fun!
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 0b088f7171..14b25681b7 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -105,13 +105,16 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) { if (!child2->cast_to<StaticBody2D>()) continue; StaticBody2D *sb = child2->cast_to<StaticBody2D>(); - int shape_count = sb->get_shape_count(); - if (shape_count == 0) - continue; - for (int shape_index = 0; shape_index < shape_count; ++shape_index) { - Ref<Shape2D> collision = sb->get_shape(shape_index); - if (collision.is_valid()) { - collisions.push_back(collision); + + List<uint32_t> shapes; + sb->get_shape_owners(&shapes); + + for (List<uint32_t>::Element *E = shapes.front(); E; E = E->next()) { + + for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) { + + Ref<Shape> shape = sb->shape_owner_get_shape(E->get(), k); + collisions.push_back(shape); //uh what about transform? } } } |