summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-31 00:03:40 +0200
committerGitHub <noreply@github.com>2022-07-31 00:03:40 +0200
commit960567e17b3dacb2851fd0ab86448ba38992d114 (patch)
tree0c2d3f0193e204ffb9822352287bdfd003cb5430
parentc2d55a4e1a353b75eb598277e9a6403fc6bfc4d5 (diff)
parent54a9dcfa40589a4ee3a9f45ad3d9752178630bd1 (diff)
Merge pull request #63692 from rburing/nonexistent_debug_shapes_dont_move
Don't move nonexistent debug shapes
-rw-r--r--scene/3d/collision_object_3d.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp
index 0871bf536b..9a5d4f5480 100644
--- a/scene/3d/collision_object_3d.cpp
+++ b/scene/3d/collision_object_3d.cpp
@@ -403,6 +403,9 @@ void CollisionObject3D::_on_transform_changed() {
debug_shape_old_transform = get_global_transform();
for (KeyValue<uint32_t, ShapeData> &E : shapes) {
ShapeData &shapedata = E.value;
+ if (shapedata.disabled) {
+ continue; // If disabled then there are no debug shapes to update.
+ }
const ShapeData::ShapeBase *shapes = shapedata.shapes.ptr();
for (int i = 0; i < shapedata.shapes.size(); i++) {
RS::get_singleton()->instance_set_transform(shapes[i].debug_shape, debug_shape_old_transform * shapedata.xform);