summaryrefslogtreecommitdiff
path: root/modules/csg/csg_shape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/csg/csg_shape.cpp')
-rw-r--r--modules/csg/csg_shape.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index b08810c7e4..376dfe5031 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -132,18 +132,13 @@ void CSGShape3D::_make_dirty() {
return;
}
- if (dirty) {
- return;
- }
-
- dirty = true;
-
if (parent) {
parent->_make_dirty();
- } else {
- //only parent will do
+ } else if (!dirty) {
call_deferred("_update_shape");
}
+
+ dirty = true;
}
CSGBrush *CSGShape3D::_get_brush() {
@@ -511,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();
@@ -646,7 +647,7 @@ CSGShape3D::~CSGShape3D() {
//////////////////////////////////
CSGBrush *CSGCombiner3D::_build_brush() {
- return nullptr; //does not build anything
+ return memnew(CSGBrush); //does not build anything
}
CSGCombiner3D::CSGCombiner3D() {