From 0859d5b60f550a3344d40c8f936acdcae36c8fb1 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 12 Sep 2022 06:46:48 +0100 Subject: [PATCH] Portals - Show RayCast debug helper Switches the raycast helper to global portal_mode, allowing it to show when portals are active. --- scene/3d/ray_cast.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 9bfa43d6e..ddec548b6 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -414,6 +414,12 @@ void RayCast::_create_debug_shape() { Ref mesh = memnew(ArrayMesh); MeshInstance *mi = memnew(MeshInstance); +#ifdef TOOLS_ENABLED + // This enables the debug helper to show up in editor runs. + // However it should not show up during export, because global mode + // can slow the portal system, and this should only be used for debugging. + mi->set_portal_mode(CullInstance::PORTAL_MODE_GLOBAL); +#endif mi->set_mesh(mesh); add_child(mi);