diff options
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/collision_object_2d.cpp | 6 | ||||
-rw-r--r-- | scene/2d/collision_object_2d.h | 2 | ||||
-rw-r--r-- | scene/2d/tile_map.cpp | 8 |
3 files changed, 7 insertions, 9 deletions
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 0821b00dd9..c5c274e225 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -204,10 +204,10 @@ int CollisionObject2D::shape_owner_get_shape_count(uint32_t p_owner) const { return shapes[p_owner].shapes.size(); } -Ref<Shape2D> CollisionObject2D::shape_owner_get_shape(uint32_t p_owner, int p_shape) const { +Ref<Shape> CollisionObject2D::shape_owner_get_shape(uint32_t p_owner, int p_shape) const { - ERR_FAIL_COND_V(!shapes.has(p_owner), Ref<Shape2D>()); - ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), Ref<Shape2D>()); + ERR_FAIL_COND_V(!shapes.has(p_owner), Ref<Shape>()); + ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), Ref<Shape>()); return shapes[p_owner].shapes[p_shape].shape; } diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 3580d3d942..deffe8a002 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -94,7 +94,7 @@ public: void shape_owner_add_shape(uint32_t p_owner, const Ref<Shape2D> &p_shape); int shape_owner_get_shape_count(uint32_t p_owner) const; - Ref<Shape2D> shape_owner_get_shape(uint32_t p_owner, int p_shape) const; + Ref<Shape> shape_owner_get_shape(uint32_t p_owner, int p_shape) const; int shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const; void shape_owner_remove_shape(uint32_t p_owner, int p_shape); diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 9d70b75027..57e25ec609 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -461,18 +461,16 @@ void TileMap::_update_dirty_quadrants() { Transform2D xform; xform.set_origin(offset.floor()); - _fix_cell_transform(xform, c, center_ofs, s); - - xform *= shapes[i].shape_transform; + _fix_cell_transform(xform, c, shapes[i].shape_offset + center_ofs, s); 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); - 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++; + 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)); } } |