You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
-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!
This commit is contained in:
@@ -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?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user