From 6ba1e4677ba15992c750bddffcb9f1eacd1558a1 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 23 Jun 2017 23:30:43 -0300 Subject: -Trigger shapes removed in 2D, they became obsolete long ago when areas could detect their own overlap -Added ability to disable individual collisionshape/polygon -Moved One Way Collision to shape, allowing more flexibility -Changed internals of CollisionObject, shapes are generated from child nodes on the fly, not stored inside any longer. -Modifying a CollisionPolygon2D on the fly now works, it can even be animated. Will port this to 3D once well tested. Have fun! --- servers/physics_2d_server.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'servers/physics_2d_server.h') diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h index 80113dd7d..f25f05baf 100644 --- a/servers/physics_2d_server.h +++ b/servers/physics_2d_server.h @@ -332,6 +332,8 @@ public: virtual void area_remove_shape(RID p_area, int p_shape_idx) = 0; virtual void area_clear_shapes(RID p_area) = 0; + virtual void area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) = 0; + virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID) = 0; virtual ObjectID area_get_object_instance_ID(RID p_area) const = 0; @@ -380,8 +382,8 @@ public: virtual Transform2D body_get_shape_transform(RID p_body, int p_shape_idx) const = 0; virtual Variant body_get_shape_metadata(RID p_body, int p_shape_idx) const = 0; - virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) = 0; - virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const = 0; + virtual void body_set_shape_disabled(RID p_body, int p_shape, bool p_disabled) = 0; + virtual void body_set_shape_as_one_way_collision(RID p_body, int p_shape, bool p_enabled) = 0; virtual void body_remove_shape(RID p_body, int p_shape_idx) = 0; virtual void body_clear_shapes(RID p_body) = 0; @@ -451,12 +453,6 @@ public: virtual void body_set_max_contacts_reported(RID p_body, int p_contacts) = 0; virtual int body_get_max_contacts_reported(RID p_body) const = 0; - virtual void body_set_one_way_collision_direction(RID p_body, const Vector2 &p_direction) = 0; - virtual Vector2 body_get_one_way_collision_direction(RID p_body) const = 0; - - virtual void body_set_one_way_collision_max_depth(RID p_body, float p_max_depth) = 0; - virtual float body_get_one_way_collision_max_depth(RID p_body) const = 0; - //missing remove virtual void body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold) = 0; virtual float body_get_contacts_reported_depth_treshold(RID p_body) const = 0; -- cgit v1.2.3-70-g09d2