diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2020-07-08 00:51:25 +0200 |
---|---|---|
committer | Tomasz Chabora <kobewi4e@gmail.com> | 2020-07-10 13:23:20 +0200 |
commit | 7eebb06b5571437828d8c5099558c303c72cd1f4 (patch) | |
tree | 376aa2b82cbe66d8f4aad4c21aab2281ec7b78e1 /servers/physics_3d/space_3d_sw.cpp | |
parent | d0e0a19e4daa88b91613d92b0520035a1c4f5e9a (diff) |
Allow Area2D and 3D mouse events without a collision layer
Co-authored-by: madmiraal <madmiraal@users.noreply.github.com>
Diffstat (limited to 'servers/physics_3d/space_3d_sw.cpp')
-rw-r--r-- | servers/physics_3d/space_3d_sw.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/physics_3d/space_3d_sw.cpp b/servers/physics_3d/space_3d_sw.cpp index 48f250ba35..aa4cb894dd 100644 --- a/servers/physics_3d/space_3d_sw.cpp +++ b/servers/physics_3d/space_3d_sw.cpp @@ -34,8 +34,8 @@ #include "core/project_settings.h" #include "physics_server_3d_sw.h" -_FORCE_INLINE_ static bool _can_collide_with(CollisionObject3DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) { - if (!(p_object->get_collision_layer() & p_collision_mask)) { +_FORCE_INLINE_ static bool _can_collide_with(CollisionObject3DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_ignore_layers = false) { + if (!p_ignore_layers && !(p_object->get_collision_layer() & p_collision_mask)) { return false; } @@ -117,7 +117,7 @@ bool PhysicsDirectSpaceState3DSW::intersect_ray(const Vector3 &p_from, const Vec real_t min_d = 1e10; for (int i = 0; i < amount; i++) { - if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas)) { + if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas, p_pick_ray)) { continue; } |