From f7c3d6329cdc9c21c205f1522813090313a422d2 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Sat, 9 Apr 2016 21:54:09 +0300 Subject: Port collision and layer masks to 3D, fixes #1759 Raycasts now have type_mask and layer_mask. Areas - collision_mask and layer_mask. PhysicsBodies needed only collision_mask. --- servers/physics_server.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'servers/physics_server.cpp') diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index 89fcffe7ed..685477ed79 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -457,6 +457,8 @@ void PhysicsServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&PhysicsServer::area_remove_shape); ObjectTypeDB::bind_method(_MD("area_clear_shapes","area"),&PhysicsServer::area_clear_shapes); + ObjectTypeDB::bind_method(_MD("area_set_layer_mask","area","mask"),&PhysicsServer::area_set_layer_mask); + ObjectTypeDB::bind_method(_MD("area_set_collision_mask","area","mask"),&PhysicsServer::area_set_collision_mask); ObjectTypeDB::bind_method(_MD("area_set_param","area","param","value"),&PhysicsServer::area_set_param); ObjectTypeDB::bind_method(_MD("area_set_transform","area","transform"),&PhysicsServer::area_set_transform); @@ -480,6 +482,12 @@ void PhysicsServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("body_set_mode","body","mode"),&PhysicsServer::body_set_mode); ObjectTypeDB::bind_method(_MD("body_get_mode","body"),&PhysicsServer::body_get_mode); + ObjectTypeDB::bind_method(_MD("body_set_layer_mask","body","mask"),&PhysicsServer::body_set_layer_mask); + ObjectTypeDB::bind_method(_MD("body_get_layer_mask","body"),&PhysicsServer::body_get_layer_mask); + + ObjectTypeDB::bind_method(_MD("body_set_collision_mask","body","mask"),&PhysicsServer::body_set_collision_mask); + ObjectTypeDB::bind_method(_MD("body_get_collision_mask","body"),&PhysicsServer::body_get_collision_mask); + ObjectTypeDB::bind_method(_MD("body_add_shape","body","shape","transform"),&PhysicsServer::body_add_shape,DEFVAL(Transform())); ObjectTypeDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&PhysicsServer::body_set_shape); ObjectTypeDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&PhysicsServer::body_set_shape_transform); -- cgit v1.2.3