Skip to content

Commit

Permalink
Do not create wirebox with empty AABB (ogre) (#1083)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <ichen@openrobotics.org>
  • Loading branch information
iche033 authored Nov 6, 2024
1 parent 1f4def6 commit 9e874c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ogre/src/OgreWireBox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9e874c0

Please sign in to comment.