From 8330e70e2cc935a92cf11862b68f6cfa0ce66fe8 Mon Sep 17 00:00:00 2001 From: RaphaelHunter Date: Thu, 14 Nov 2019 15:48:41 +0800 Subject: refresh area2d collision when shape changes, close #33369 --- servers/physics/area_sw.cpp | 3 +++ servers/physics_2d/area_2d_sw.cpp | 3 +++ 2 files changed, 6 insertions(+) (limited to 'servers') diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp index ad3e40916d..16f2fa45ea 100644 --- a/servers/physics/area_sw.cpp +++ b/servers/physics/area_sw.cpp @@ -46,6 +46,9 @@ AreaSW::BodyKey::BodyKey(AreaSW *p_body, uint32_t p_body_shape, uint32_t p_area_ } void AreaSW::_shapes_changed() { + + if (!moved_list.in_list() && get_space()) + get_space()->area_add_to_moved_list(&moved_list); } void AreaSW::set_transform(const Transform &p_transform) { diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp index 9ec1eacd29..9275e8883f 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -46,6 +46,9 @@ Area2DSW::BodyKey::BodyKey(Area2DSW *p_body, uint32_t p_body_shape, uint32_t p_a } void Area2DSW::_shapes_changed() { + + if (!moved_list.in_list() && get_space()) + get_space()->area_add_to_moved_list(&moved_list); } void Area2DSW::set_transform(const Transform2D &p_transform) { -- cgit v1.2.3