diff options
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r-- | scene/2d/tile_map.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 57e25ec609..9d70b75027 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -461,16 +461,18 @@ void TileMap::_update_dirty_quadrants() { Transform2D xform; xform.set_origin(offset.floor()); - _fix_cell_transform(xform, c, shapes[i].shape_offset + center_ofs, s); + _fix_cell_transform(xform, c, center_ofs, s); + + xform *= shapes[i].shape_transform; if (debug_canvas_item.is_valid()) { vs->canvas_item_add_set_transform(debug_canvas_item, xform); shape->draw(debug_canvas_item, debug_collision_color); } ps->body_add_shape(q.body, shape->get_rid(), xform); - shape_idx++; - ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[i].one_way_collision); ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); + ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[i].one_way_collision); + shape_idx++; } } |