Skip to content

Commit e5aef4d

Browse files
committed
Fix item visibility check when building GI Vct (#1216)
Signed-off-by: Ian Chen <ichen@openrobotics.org> (cherry picked from commit 2ca3773)
1 parent f9e6fd2 commit e5aef4d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ogre2/src/Ogre2GlobalIlluminationVct.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,10 @@ void Ogre2GlobalIlluminationVct::Build()
274274
for (size_t k = 0; k < ARRAY_PACKED_REALS; ++k)
275275
{
276276
// objData.mOwner is guaranteed by Ogre to not be a nullptr
277-
if (objData.mOwner[k]->getVisible())
277+
auto item = dynamic_cast<Ogre::Item *>(objData.mOwner[k]);
278+
if (item && item->getVisible())
278279
{
279-
auto item = dynamic_cast<Ogre::Item *>(objData.mOwner[k]);
280-
if (item)
281-
{
282-
voxelizer->addItem(item, false);
283-
}
280+
voxelizer->addItem(item, false);
284281
}
285282
}
286283

0 commit comments

Comments
 (0)