36 SkyXManager::SkyXManager(Ogre::String configFile)
46 mCfgFileManager->load(configFile);
54 SkyXManager::~SkyXManager()
61 delete mBasicController;
62 mBasicController =
nullptr;
65 Vector3 SkyXManager::getMainLightDirection()
67 if (mBasicController !=
nullptr)
68 return mBasicController->getSunDirection();
69 return Ogre::Vector3(0.0,0.0,0.0);
72 Light *SkyXManager::getMainLight()
77 bool SkyXManager::update(
float dt)
85 bool SkyXManager::UpdateSkyLight()
87 Ogre::Vector3 lightDir = -getMainLightDirection();
89 Ogre::Vector3 sunPos = camPos - lightDir*mSkyX->getMeshManager()->getSkydomeRadius(
App::GetCameraManager()->GetCamera());
92 float point = (-lightDir.y + 1.0f) / 2.0f;
104 mLight0->setPosition(sunPos*0.02);
105 mLight1->setDirection(lightDir);
116 Ogre::Vector3 ambientCol = mAmbientGradient.getColor(point);
117 mLight1->setDiffuseColour(ambientCol.x, ambientCol.y, ambientCol.z);
118 mLight1->setPosition(100,100,100);
120 if (mBasicController->getTime().x > 12)
122 if (mBasicController->getTime().x > mBasicController->getTime().z)
123 mLight0->setVisible(
false);
125 mLight0->setVisible(
true);
129 if (mBasicController->getTime ().x < mBasicController->getTime ().z)
130 mLight0->setVisible (
false);
132 mLight0->setVisible (
true);
135 if (round (mBasicController->getTime ().x) != mLastHour)
141 mLastHour = round (mBasicController->getTime ().x);
147 bool SkyXManager::InitLight()
178 mLight0->setDiffuseColour(1, 1, 1);
179 mLight0->setCastShadows(
false);
182 mLight1->setType(Ogre::Light::LT_DIRECTIONAL);
187 size_t SkyXManager::getMemoryUsage()
193 void SkyXManager::freeResources()