//----------------------------------------------------------------------- void TerrainLiquidObject::destroyTerrainLiquid(void) { _deleteRenderTextureRelative(); assert(mTerrainLiquid); Ogre::SceneNode* parent = mTerrainLiquid->getParentSceneNode(); assert(parent); if (!mProjectionMaterial.isNull()) { Ogre::MaterialManager::getSingleton().remove(mProjectionMaterial->getHandle()); mProjectionMaterial.setNull(); } if (mProjectionCamera) { parent->getCreator()->destroyCamera(mProjectionCamera); mProjectionCamera = 0; } parent->getCreator()->destroySceneNode(parent); parent = NULL; delete mTerrainLiquid; mTerrainLiquid = NULL; }
/** * @brief Dtor. */ ~EntityPointMarker() { if (mMarkerEntity) { mMarkerEntity->_getManager()->destroyEntity(mMarkerEntity); } if (mMarkerNode) { mMarkerNode->getCreator()->destroySceneNode(mMarkerNode); } delete mMarkerDirectionIndicator; }
//----------------------------------------------------------------------- void ActorObject::createActor(void) { assert(!mActor); assert(mProxy && !mActorName.empty()); Ogre::SceneNode* parent = getSceneNode(); assert(parent); Ogre::SceneManager* creator = parent->getCreator(); assert(creator); mActor = new Actor(mSystem, parent->getName(), mActorName, parent); mActor->setUserObject(mProxy); }
//--------------------------------------------------------------------- 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 AuthoringManager::displayGeometryVisualization(EmberEntity& entity) { if (!mGeometryVisualizations.count(&entity)) { Ogre::SceneNode* node = mWorld.getScene().getSceneManager().getRootSceneNode()->createChildSceneNode(); GeometryVisualization* vis(nullptr); try { vis = new GeometryVisualization(entity, node); } catch (const std::exception& ex) { S_LOG_WARNING("Error when displaying geometry." << ex); //just delete the node and return node->getCreator()->destroySceneNode(node); return; } sigc::connection conn = entity.BeingDeleted.connect([&]() {hideGeometryVisualization(entity); }); mGeometryVisualizations.insert(std::make_pair(&entity, std::make_pair(vis, conn))); } }
void AuthoringManager::displaySimpleEntityVisualization(EmberEntity& entity) { if (!mSimpleVisualizations.count(&entity)) { Ogre::SceneNode* node = mWorld.getScene().getSceneManager().getRootSceneNode()->createChildSceneNode(); SimpleEntityVisualization* vis(0); try { vis = new SimpleEntityVisualization(entity, node); } catch (const std::exception& ex) { //just delete the node and return node->getCreator()->destroySceneNode(node); return; } sigc::connection conn = entity.BeingDeleted.connect(sigc::bind(sigc::mem_fun(*this, &AuthoringManager::simpleEntityVisualizationBeingDeleted), &entity)); mSimpleVisualizations.insert(SimpleEntityVisualizationStore::value_type(&entity, std::make_pair(vis, conn))); } }
//----------------------------------------------------------------------- void ParticleSystemObject::createParticleSystem(void) { assert( mParticleSystem == NULL ); assert(!mParticleSystemName.empty()); Ogre::SceneNode* parent = getSceneNode(); if (parent) { mParticleSystem = parent->getCreator()->createParticleSystem( parent->getName(), mParticleSystemName ); assert(mParticleSystem); // Set render queue for particle system, the particle system should be render after world geometry 2 mParticleSystem->setRenderQueueGroup(Ogre::RENDER_QUEUE_8); parent->attachObject(mParticleSystem); } }
//----------------------------------------------------------------------- void MeshParticleVisualData::modifyMesh(const String &meshName) { // destroy old entity assert(mEntity); Ogre::SceneNode* parent = mEntity->getParentSceneNode(); assert(parent); Ogre::SceneManager* creator = parent->getCreator(); assert(creator); parent->detachObject(mEntity->getName()); creator->destroyMovableObject(mEntity); mEntity = NULL; // create new entity mEntity = creator->createEntity( mSceneNode->getName(), meshName ); assert (mEntity); mSceneNode->attachObject(mEntity); }
void DisableDecalGrids::_destroyProjector(void) { if (mProjector) { Ogre::SceneNode* parent = mProjector->getParentSceneNode(); assert(parent); Ogre::SceneManager* creator = parent->getCreator(); assert(creator); assert (parent == mProjectorNode); parent->detachObject(mProjector->getName()); getSceneManipulator()->getSceneManager()->destroyMovableObject(mProjector); mProjector = NULL; if (mProjectorNode) { getSceneManager()->destroySceneNode(mProjectorNode); mProjectorNode = NULL; } } }