//--------------------------------------------------------------------- void BillboardSetElement::_destroyBillboardSet(void) { if (mBillboardSet) { Ogre::SceneNode* parent = mBillboardSet->getParentSceneNode(); assert(parent); Ogre::SceneManager* creator = parent->getCreator(); assert(creator); parent->detachObject(mBillboardSet->getName()); creator->destroyBillboardSet(mBillboardSet); } }
void EC_HoveringText::Destroy() { if (!ViewEnabled()) return; if (!world_.expired()) { Ogre::SceneManager* sceneMgr = world_.lock()->OgreSceneManager(); try{ Ogre::MaterialManager::getSingleton().remove(materialName_); } catch(...) { } try{ if (billboardSet_ && billboard_) billboardSet_->removeBillboard(billboard_); } catch(...) { } try{ if (billboardSet_) { sceneMgr->destroyBillboardSet(billboardSet_); } } catch(...) { } } billboard_ = 0; billboardSet_ = 0; textureName_ = ""; materialName_ = ""; }