From 371eac9beffdfe416b8555ee006baf0ffae2bef3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 16 Oct 2014 00:06:34 -0300 Subject: -added custom metadata to physics shapes (2D only for now) -gizmos are not displayed in camera preview --- servers/physics_2d_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'servers/physics_2d_server.cpp') diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index da8ac5f9c..cfa79e917 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -97,6 +97,7 @@ void Physics2DDirectBodyState::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id); ObjectTypeDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object); ObjectTypeDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape); + ObjectTypeDB::bind_method(_MD("get_contact_collider_shape_metadata:var","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); ObjectTypeDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos); ObjectTypeDB::bind_method(_MD("get_step"),&Physics2DDirectBodyState::get_step); ObjectTypeDB::bind_method(_MD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces); @@ -244,6 +245,7 @@ Dictionary Physics2DDirectSpaceState::_intersect_ray(const Vector2& p_from, cons d["collider"]=inters.collider; d["shape"]=inters.shape; d["rid"]=inters.rid; + d["metadata"]=inters.metadata; return d; } @@ -262,6 +264,7 @@ Array Physics2DDirectSpaceState::_intersect_shape(const Ref