aboutsummaryrefslogtreecommitdiff
path: root/servers/physics_2d/physics_2d_server_sw.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 /servers/physics_2d/physics_2d_server_sw.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 'servers/physics_2d/physics_2d_server_sw.cpp')
-rw-r--r--servers/physics_2d/physics_2d_server_sw.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp
index 09fa3f9b6..ab85f5e1d 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_2d_server_sw.cpp
@@ -548,6 +548,22 @@ void Physics2DServerSW::body_set_shape_transform(RID p_body, int p_shape_idx, co
body->set_shape_transform(p_shape_idx,p_transform);
}
+void Physics2DServerSW::body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant& p_metadata) {
+
+ Body2DSW *body = body_owner.get(p_body);
+ ERR_FAIL_COND(!body);
+ body->set_shape_metadata(p_shape_idx,p_metadata);
+}
+
+
+Variant Physics2DServerSW::body_get_shape_metadata(RID p_body, int p_shape_idx) const {
+
+ Body2DSW *body = body_owner.get(p_body);
+ ERR_FAIL_COND_V(!body,Variant());
+ return body->get_shape_metadata(p_shape_idx);
+}
+
+
int Physics2DServerSW::body_get_shape_count(RID p_body) const {
Body2DSW *body = body_owner.get(p_body);