summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/collision_object_3d.cpp3
-rw-r--r--scene/3d/shape_cast_3d.cpp8
2 files changed, 9 insertions, 2 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);
diff --git a/scene/3d/shape_cast_3d.cpp b/scene/3d/shape_cast_3d.cpp
index df8bd7dfc9..ac804280fe 100644
--- a/scene/3d/shape_cast_3d.cpp
+++ b/scene/3d/shape_cast_3d.cpp
@@ -577,14 +577,18 @@ void ShapeCast3D::_update_debug_shape() {
_create_debug_shape();
}
+ _update_debug_shape_vertices();
+
+ if (Engine::get_singleton()->is_editor_hint()) {
+ return;
+ }
+
MeshInstance3D *mi = static_cast<MeshInstance3D *>(debug_shape);
Ref<ArrayMesh> mesh = mi->get_mesh();
if (!mesh.is_valid()) {
return;
}
- _update_debug_shape_vertices();
-
mesh->clear_surfaces();
Array a;