summaryrefslogtreecommitdiff
path: root/modules/csg
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-08-11 11:58:36 +0200
committerGitHub <noreply@github.com>2020-08-11 11:58:36 +0200
commit3044b8f15af91aac4177c59bb5455dcd33a1a6c3 (patch)
tree991a74606190c1d46dbd90f97fa961d0daef95ce /modules/csg
parent920f8c86ec7fe6172365b89a7c290af956e8e8e3 (diff)
parentfc8574fbac1073f4d68197dc8a2b3504bfc8970d (diff)
Merge pull request #40935 from hoontee/master-3
Transform CSGShape collision when necessary
Diffstat (limited to 'modules/csg')
-rw-r--r--modules/csg/csg_shape.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index a10e03b3b2..8f2ebc7232 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -506,6 +506,12 @@ void CSGShape3D::_notification(int p_what) {
_make_dirty();
}
+ if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
+ if (use_collision && is_root_shape() && root_collision_instance.is_valid()) {
+ PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
+ }
+ }
+
if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
if (parent) {
parent->_make_dirty();