diff options
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 4 | ||||
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 433942708e..2b0eab5999 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -1011,6 +1011,10 @@ void ConcavePolygonShape2DSW::cull(const Rect2 &p_local_aabb, Callback p_callbac stack[i]=0; */ + if (segments.size() == 0 || points.size() == 0 || bvh.size() == 0) { + return; + } + int level = 0; const Segment *segmentptr = &segments[0]; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index c29093d1af..503ca0af4a 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -33,6 +33,7 @@ #include "collision_solver_2d_sw.h" #include "pair.h" #include "physics_2d_server_sw.h" + _FORCE_INLINE_ static bool _can_collide_with(CollisionObject2DSW *p_object, uint32_t p_collision_mask) { return p_object->get_collision_layer() & p_collision_mask; |