Merge pull request #65686 from lawnjelly/portals_show_raycast

Portals - Show RayCast debug helper
This commit is contained in:
Rémi Verschelde 2022-09-12 11:34:25 +02:00
commit a10c2d4a38
1 changed files with 6 additions and 0 deletions

View File

@ -411,6 +411,12 @@ void RayCast::_create_debug_shape() {
Ref<ArrayMesh> 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);