diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-08-21 15:30:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-08-21 15:31:23 -0300 |
commit | ee07fb5ebee339559da46f9d183418bbee2188e5 (patch) | |
tree | 4117451bf06046e2916596edc84a4d3f6cbcd592 /servers/physics_server.h | |
parent | 28e9aedbddb41f240ff7b416c8359673d3505a79 (diff) |
Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding.
Diffstat (limited to 'servers/physics_server.h')
-rw-r--r-- | servers/physics_server.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/servers/physics_server.h b/servers/physics_server.h index 3bd47a6601..f2aa33a6cc 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -108,6 +108,9 @@ class PhysicsShapeQueryParameters : public Reference { Set<RID> exclude; uint32_t collision_mask; + bool collide_with_bodies; + bool collide_with_areas; + protected: static void _bind_methods(); @@ -128,6 +131,12 @@ public: void set_exclude(const Vector<RID> &p_exclude); Vector<RID> get_exclude() const; + void set_collide_with_bodies(bool p_enable); + bool is_collide_with_bodies_enabled() const; + + void set_collide_with_areas(bool p_enable); + bool is_collide_with_areas_enabled() const; + PhysicsShapeQueryParameters(); }; @@ -137,10 +146,10 @@ class PhysicsDirectSpaceState : public Object { private: Dictionary _intersect_ray(const Vector3 &p_from, const Vector3 &p_to, const Vector<RID> &p_exclude = Vector<RID>(), uint32_t p_collision_mask = 0, bool p_collide_with_bodies = true, bool p_collide_with_areas = false); - Array _intersect_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, bool p_collide_with_bodies = true, bool p_collide_with_areas = false, int p_max_results = 32); - Array _cast_motion(const Ref<PhysicsShapeQueryParameters> &p_shape_query, const Vector3 &p_motion, bool p_collide_with_bodies = true, bool p_collide_with_areas = false); - Array _collide_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, bool p_collide_with_bodies = true, bool p_collide_with_areas = false, int p_max_results = 32); - Dictionary _get_rest_info(const Ref<PhysicsShapeQueryParameters> &p_shape_query, bool p_collide_with_bodies = true, bool p_collide_with_areas = false); + Array _intersect_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results = 32); + Array _cast_motion(const Ref<PhysicsShapeQueryParameters> &p_shape_query, const Vector3 &p_motion); + Array _collide_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results = 32); + Dictionary _get_rest_info(const Ref<PhysicsShapeQueryParameters> &p_shape_query); protected: static void _bind_methods(); |