aboutsummaryrefslogtreecommitdiff
path: root/scene/2d/tile_map.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2014-10-16 00:06:34 -0300
committerJuan Linietsky2014-10-16 00:06:34 -0300
commit371eac9beffdfe416b8555ee006baf0ffae2bef3 (patch)
treebfb0f6dc2a0a4812d69a8aa9902ad0c42021a522 /scene/2d/tile_map.cpp
parent6e87c80e41857fe4f151cdeb8b9a7206c226bd8f (diff)
downloadgodot-371eac9beffdfe416b8555ee006baf0ffae2bef3.tar.gz
godot-371eac9beffdfe416b8555ee006baf0ffae2bef3.tar.zst
godot-371eac9beffdfe416b8555ee006baf0ffae2bef3.zip
-added custom metadata to physics shapes (2D only for now)
-gizmos are not displayed in camera preview
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r--scene/2d/tile_map.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 72ef653d1..eb04ca924 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -179,6 +179,7 @@ void TileMap::_update_dirty_quadrants() {
vs->canvas_item_clear(q.canvas_item);
ps->body_clear_shapes(q.static_body);
+ int shape_idx=0;
for(int i=0;i<q.cells.size();i++) {
@@ -259,6 +260,8 @@ void TileMap::_update_dirty_quadrants() {
ps->body_add_shape(q.static_body,shape->get_rid(),xform);
+ ps->body_set_shape_metadata(q.static_body,shape_idx++,Vector2(E->key().x,E->key().y));
+
}
}
}