From aa6de9f2aba3fc050eaa1761606b1b44084e9c89 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 8 Jan 2026 11:32:28 -0800 Subject: [PATCH] Fix item visibility check when building GI Vct (#1216) Signed-off-by: Ian Chen (cherry picked from commit 2ca37732a70dd18baf1857f797be8aeb00e1c224) --- ogre2/src/Ogre2GlobalIlluminationVct.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ogre2/src/Ogre2GlobalIlluminationVct.cc b/ogre2/src/Ogre2GlobalIlluminationVct.cc index dc09013f2..0c1cffbe8 100644 --- a/ogre2/src/Ogre2GlobalIlluminationVct.cc +++ b/ogre2/src/Ogre2GlobalIlluminationVct.cc @@ -274,13 +274,10 @@ void Ogre2GlobalIlluminationVct::Build() for (size_t k = 0; k < ARRAY_PACKED_REALS; ++k) { // objData.mOwner is guaranteed by Ogre to not be a nullptr - if (objData.mOwner[k]->getVisible()) + auto item = dynamic_cast(objData.mOwner[k]); + if (item && item->getVisible()) { - auto item = dynamic_cast(objData.mOwner[k]); - if (item) - { - voxelizer->addItem(item, false); - } + voxelizer->addItem(item, false); } }