39SSkyLight::SSkyLight(
SEnvironment* parent,
const std::string& skyLightName,
const Ogre::ColourValue& defaultBaseColour) :
SData(skyLightName)
56 ogreSkyLight->setAttenuation(100000.0f, 1.0f, 0.0f, 0.0f);
69SSkyLight::SSkyLight() :
SData(
"")
140 float gradientPoint = std::max(tmpLightDirection.y, 0.0f);
152 if (((ncolor.r + ncolor.g + ncolor.b) / 3) >= ((ccolor.r + ccolor.g + ccolor.b) / 3))
176 return -(
ogreSkyLight->getParentSceneNode()->_getDerivedOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Z);
178 return Ogre::Vector3::ZERO;
184 ogreSkyLight->getParentSceneNode()->setDirection(-direction);
198 RefreshLightColourGradient();
205 res.z = -Ogre::Math::Cos(azimuth) * Ogre::Math::Cos(altitude);
206 res.x = Ogre::Math::Sin(azimuth) * Ogre::Math::Cos(altitude);
207 res.y = Ogre::Math::Sin(altitude);
211void SSkyLight::RefreshLightColourGradient()
void AddColourFrame(const ColourFrame &colourFrame)
const Ogre::ColourValue GetColour(const float &gradientPosition) const
SUniversalClock * GetUniversalClock()
Ogre::Degree GetLatitude()
Ogre::Degree GetLongitude()
Ogre::SceneManager * GetOgreScenePointer()
Ogre::ColourValue GetAmbientLight()
Ogre::SceneManager * ogreSceneManager
void SetLightColour(const Ogre::ColourValue &newColour)
void SetCastShadowEnable(const bool &enable)
SEnvironment * parentEnvironment
Ogre::Degree lastLatitude
const Ogre::Vector3 MakeDirection(const Ogre::Degree &azimuth, const Ogre::Degree &altitude)
Ogre::SceneNode * ogreSkyLightSceneNode
bool GetCastShadowEnable()
void UpdateShadowFarDistance(const float &distance)
void SetLightDirection(const Ogre::Vector3 &direction)
const Ogre::ColourValue GetLightColour(const float &level=1.0f) const
Ogre::Degree lastLongitude
Ogre::Light * ogreSkyLight
void UpdateShadowFarClipDistance(const float &distance)
void SetEnable(const bool &enable)
const Ogre::Vector3 GetLightDirection() const
SColourGradient lightColourGradient
virtual const Ogre::Vector3 ComputeDirectionImpl(const double &julianDay)=0
Ogre::ColourValue baseColour
Ogre::Light * GetOgreLight()
SEnvironment * GetEnvironment()
double GetJulianDay() const