//-----------------------------------------------------------------------
	void LightRenderer::_destroyAll(void)
	{
		if (!mParentTechnique)
			return;

		// Note: The created ChildSceneNodes are destroyed when the ParticleSystem is destroyed
		vector<LightRendererVisualData*>::const_iterator it;
		vector<LightRendererVisualData*>::const_iterator itEnd = mAllVisualData.end();
		for (it = mAllVisualData.begin(); it != itEnd; ++it)
		{
			PU_DELETE_T(*it, LightRendererVisualData, MEMCATEGORY_SCENE_OBJECTS);
		}

		mAllVisualData.clear();
		mVisualData.clear();

		// Destroy the Lights. Do it like this, because it must be assured that the light still exists
		// and has not already been destroyed.
		Ogre::SceneManager* sceneManager = mParentTechnique->getParentSystem()->getSceneManager();
		for (size_t i = 0; i < mQuota; i++)
		{
			if (sceneManager->hasLight(mLightName + StringConverter::toString(i)))
			{
				sceneManager->destroyLight(mLightName + StringConverter::toString(i));
			}
		}
		mLights.clear();

		// Reset the visual data in the pool
		mParentTechnique->initVisualDataInPool();
	}
Пример #2
0
 void ReliefApp::ShutdownScene(void)
 {
     InfoLog << "ReliefApp::ShutdownScene" << std::endl;
     Ogre::SceneManager* pSceneMgr = MagicCore::RenderSystem::GetSingleton()->GetSceneManager();
     pSceneMgr->setAmbientLight(Ogre::ColourValue::Black);
     pSceneMgr->destroyLight("SimpleLight");
     MagicCore::RenderSystem::GetSingleton()->SetupCameraDefaultParameter();
     MagicCore::RenderSystem::GetSingleton()->HideRenderingObject("RenderMesh");
     MagicCore::RenderSystem::GetSingleton()->GetSceneManager()->getRootSceneNode()->resetToInitialState();
 }
Пример #3
0
 void DepthVideoApp::ShutdownScene(void)
 {
     Ogre::SceneManager* sceneManager = MagicCore::RenderSystem::Get()->GetSceneManager();
     sceneManager->setAmbientLight(Ogre::ColourValue::Black);
     sceneManager->destroyLight("DepthVideoApp_SimpleLight");
     MagicCore::RenderSystem::Get()->HideRenderingObject("PointCloud_DepthVideoApp");
     /*MagicCore::RenderSystem::Get()->SetupCameraDefaultParameter();
     if (MagicCore::RenderSystem::Get()->GetSceneManager()->hasSceneNode("ModelNode"))
     {
         MagicCore::RenderSystem::Get()->GetSceneManager()->getSceneNode("ModelNode")->resetToInitialState();
     }*/
 }
Пример #4
0
void PointShopApp::ShutdownScene(void)
{
    InfoLog << "PointShopApp::ShutdownScene" << std::endl;
    Ogre::SceneManager* pSceneMgr = MagicCore::RenderSystem::GetSingleton()->GetSceneManager();
    pSceneMgr->setAmbientLight(Ogre::ColourValue::Black);
    pSceneMgr->destroyLight("SimpleLight");
    MagicCore::RenderSystem::GetSingleton()->SetupCameraDefaultParameter();
    MagicCore::RenderSystem::GetSingleton()->HideRenderingObject("RenderPointSet");
    if (MagicCore::RenderSystem::GetSingleton()->GetSceneManager()->hasSceneNode("ModelNode"))
    {
        MagicCore::RenderSystem::GetSingleton()->GetSceneManager()->getSceneNode("ModelNode")->resetToInitialState();
    }
    ClearSceneData();
}
Пример #5
0
    ~Impl()
    {
        if (skyX)
        {
            // Unload normal clouds
            if (skyX->getCloudsManager())
            {
                skyX->getCloudsManager()->unregisterAll();
                skyX->getCloudsManager()->removeAll();
            }

            // Unload volumetric clouds
            if (skyX->getVCloudsManager())
                skyX->getVCloudsManager()->remove();

            skyX->remove();

            Ogre::SceneManager *sm = skyX->getSceneManager();
            if (sm)
            {
                if (sunlight)
                    sm->destroyLight(sunlight);
                if (moonlight)
                    sm->destroyLight(moonlight);
                sm->setAmbientLight(originalAmbientColor);
            }

            SAFE_DELETE(skyX); // Deletes controller
        }

        sunlight = 0;
        moonlight = 0;
        controller = 0;
        cloudLayerBottom = 0;
        cloudLayerTop = 0;
    }
Пример #6
0
EC_OgreEnvironment::~EC_OgreEnvironment()
{
    if (renderer_.expired())
        return;
    RendererPtr renderer = renderer_.lock();
        
    SetBackgoundColor(Color(0, 0, 0));
    DisableFog();

    if (sunlight_)
    {
        Ogre::SceneManager *sceneManager = renderer->GetSceneManager();
        sceneManager->destroyLight(sunlight_);
        sunlight_ = 0;
    }
#ifdef CAELUM
        ShutdownCaelum();
#endif

#ifdef HYDRAX
        ShutdownHydrax();
#endif
}