From 9e874c0483d3c3cd34477baa59db8f7d9341a14b Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 6 Nov 2024 09:36:23 -0800 Subject: [PATCH] Do not create wirebox with empty AABB (ogre) (#1083) Signed-off-by: Ian Chen --- ogre/src/OgreWireBox.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ogre/src/OgreWireBox.cc b/ogre/src/OgreWireBox.cc index e44c064ba..c071af58d 100644 --- a/ogre/src/OgreWireBox.cc +++ b/ogre/src/OgreWireBox.cc @@ -84,6 +84,9 @@ void OgreWireBox::Create() this->scene->OgreSceneManager()->createManualObject(this->name); } + if (this->box == math::AxisAlignedBox()) + return; + this->dataPtr->manualObject->clear(); this->dataPtr->manualObject->setCastShadows(false); @@ -169,6 +172,10 @@ void OgreWireBox::SetMaterial(MaterialPtr _material, bool _unique) ////////////////////////////////////////////////// void OgreWireBox::SetMaterialImpl(OgreMaterialPtr _material) { + if (!this->dataPtr->manualObject || + this->dataPtr->manualObject->getNumSections() == 0u) + return; + std::string materialName = _material->Name(); Ogre::MaterialPtr ogreMaterial = _material->Material(); this->dataPtr->manualObject->setMaterialName(0, materialName);