diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-03-16 17:56:47 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-03-16 18:02:33 -0700 |
commit | 9798a52a2063976fd5cac75dc5be693e76deaab8 (patch) | |
tree | 406dec2a1820969c7092e327ca4cd5d56ff135da | |
parent | 8e293bac4e4c75179c0691f358fd8ef57a2bcf93 (diff) |
Disable debug collision shapes in the editor
If the editor was started with --debug-collisions, 3d shapes were
displayed twice, both with the gizmo and debug shapes. Some shapes could
also persist after being removed due to the usage of queue_free() to
destroy the debug shapes.
-rw-r--r-- | scene/3d/collision_object_3d.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index 849ef7a2bf..39880db29c 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -30,6 +30,7 @@ #include "collision_object_3d.h" +#include "core/config/engine.h" #include "mesh_instance_3d.h" #include "scene/scene_string_names.h" #include "servers/physics_server_3d.h" @@ -139,7 +140,7 @@ void CollisionObject3D::_update_debug_shapes() { } void CollisionObject3D::_update_shape_data(uint32_t p_owner) { - if (is_inside_tree() && get_tree()->is_debugging_collisions_hint()) { + if (is_inside_tree() && get_tree()->is_debugging_collisions_hint() && !Engine::get_singleton()->is_editor_hint()) { if (debug_shapes_to_update.is_empty()) { call_deferred("_update_debug_shapes"); } |