SO3Engine
|
SO3Sky.cpp
Go to the documentation of this file.
44SSky::SSky(SEnvironment* parent, const std::string& skyName) : SEnvironmentComponent(parent, skyName)
106 skyxManager->setTimeMultiplier(parentEnvironment->GetTimeSpeedFactor() / SO3_SKY_DEFAULT_TIME_MULTIPLIER);
255 Ogre::MaterialPtr moonMaterial = static_cast<Ogre::MaterialPtr> (Ogre::MaterialManager::getSingleton().getByName(skyxManager->getGPUManager()->getMoonMaterialName()));
290 // Not true, but avoid the layered cloud animation to stop. The stars rotation will be un-noticiable.
295 skyxManager->setTimeMultiplier(parentEnvironment->GetTimeSpeedFactor() / SO3_SKY_DEFAULT_TIME_MULTIPLIER);
391 if (skyxManager && volumetricClouds && GetComponent(SSky::SO3_SKY_COMPONENT_VOLUMETRIC_CLOUD)->GetEnabled())
405void SSky::AddLightning(const Ogre::Vector3 from, const Ogre::Vector3 dir, const Ogre::Real length)
407 if (skyxManager && volumetricClouds && GetComponent(SSky::SO3_SKY_COMPONENT_VOLUMETRIC_CLOUD)->GetEnabled() && skyLightningEnable)
422SSky::SkyComponent::SkyComponent(SSky* parentSkyInstance, const SSky::SkyComponentType& component) : componentType(component)
465SSky::CloudLayered::CloudLayered(SSky* parentSkyInstance) : SSky::SkyComponent(parentSkyInstance, SSky::SO3_SKY_COMPONENT_LAYERER_CLOUD)
512 skyxCloudLayerOptions->WindDirection = Ogre::Vector2(parentSky->GetEnvironment()->GetWindDirection().x, -parentSky->GetEnvironment()->GetWindDirection().y);
527 skyxCloudLayerOptions->TimeMultiplier = -SO3_SKY_DEFAULT_TIME_MULTIPLIER * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
529 skyxCloudLayerOptions->TimeMultiplier = SO3_SKY_DEFAULT_TIME_MULTIPLIER * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
534 skyxCloudLayerOptions->TimeMultiplier = -SO3_SKY_DEFAULT_TIME_MULTIPLIER / speed * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
547unsigned int SSky::CloudLayered::AddLayer(const Ogre::Real& heightFromCloudCeiling, const Ogre::Real& scale, const Ogre::Real& distanceAttenuation, const Ogre::Real& detailAttenuation, const Ogre::Real& heightVolume, const Ogre::Real& volumetricDisplacement)
571 skyxCloudLayerOptions->WindDirection = Ogre::Vector2(parentSky->GetEnvironment()->GetWindDirection().x, -parentSky->GetEnvironment()->GetWindDirection().y);
576 skyxCloudLayerOptions->TimeMultiplier = -SO3_SKY_DEFAULT_TIME_MULTIPLIER * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
578 skyxCloudLayerOptions->TimeMultiplier = SO3_SKY_DEFAULT_TIME_MULTIPLIER * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
583 skyxCloudLayerOptions->TimeMultiplier = -SO3_SKY_DEFAULT_TIME_MULTIPLIER / speed * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
585 skyxCloudLayerOptions->TimeMultiplier = SO3_SKY_DEFAULT_TIME_MULTIPLIER / speed * parentSky->GetEnvironment()->GetWindSpeed() * 0.1f;
605 SkyX::CloudLayer* skyxCloudLayer = skyxManager->getCloudsManager()->add(*(iLayerOptions->second));
671 OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND, "Cannot find cloud layer, there's no layer associated with this index!", "SSky::CloudLayered::GetLayerOptions");
676void SSky::CloudLayered::SetParameters(const unsigned int& index, const float& heightFromCloudCeiling, const float& scale, const float& attenuationDistance, const float& attenuationDetail, const float& heightVolume, const float& volumetricDisplacement)
693void SSky::CloudLayered::SetHeightFromCloudCeiling(const unsigned int& index, const Ogre::Real& newHeightFromCloudCeiling)
715void SSky::CloudLayered::SetAttenuationDistance(const unsigned int& index, const Ogre::Real& newAttenuationDistance)
726void SSky::CloudLayered::SetAttenuationDetail(const unsigned int& index, const Ogre::Real& newAttenuationDetail)
737void SSky::CloudLayered::SetHeightVolume(const unsigned int& index, const Ogre::Real& newHeightVolume)
748void SSky::CloudLayered::SetVolumetricDisplacement(const unsigned int& index, const Ogre::Real& newVolumetricDisplacement)
757SSky::CloudVolumetric::CloudVolumetric(SSky* parentSkyInstance) : SSky::SkyComponent(parentSkyInstance, SSky::SO3_SKY_COMPONENT_VOLUMETRIC_CLOUD)
820 skyxVolumetricCloudsManager->setWindSpeed(parentSky->GetAnimationSpeed() * cachedWindSpeed * 0.5f * (cachedCloudCeiling / 7.5f));
823 skyxVolumetricClouds->setWindDirection(Ogre::Math::ATan2(cachedWindDirection.x, -cachedWindDirection.y));
861 // Update wind speed? !Cloud ceiling scale the geometry, so adapt the speed with the geometry size!
869 if((cachedWindSpeed != newWindSpeed) || (cachedCloudCeiling != newCloudCeiling) || (cachedWindDirection != newWindDirection))
874 skyxVolumetricCloudsManager->setWindSpeed(parentSky->GetAnimationSpeed() * newWindSpeed * 0.5f * (newCloudCeiling / 7.5f));
879 skyxVolumetricClouds->setWindDirection(Ogre::Math::ATan2(newWindDirection.x, -newWindDirection.y));
917 Ogre::ColourValue lightSourceColour = sun->GetLightColour((0.9f - moonLightTreshold) / (1.0f - moonLightTreshold));
918 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 1.0f));
919 lightSourceColour = sun->GetLightColour((0.75f - moonLightTreshold) / (1.0f - moonLightTreshold));
920 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.75f));
921 lightSourceColour = sun->GetLightColour((0.5625f - moonLightTreshold) / (1.0f - moonLightTreshold));
922 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.5625f));
923 lightSourceColour = sun->GetLightColour((0.5f - moonLightTreshold) / (1.0f - moonLightTreshold));
924 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.5f));
925 lightSourceColour = sun->GetLightColour((0.4725f - moonLightTreshold) / (1.0f - moonLightTreshold));
926 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.4725f));
927 lightSourceColour = sun->GetLightColour((0.45f - moonLightTreshold) / (1.0f - moonLightTreshold));
928 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.45f));
929 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.0, 0.0, 0.0), 0.4125f)); // Sun-Moon threshold
930 lightSourceColour = moon->GetLightColour((0.45f - moonLightTreshold) / (1.0f - moonLightTreshold));
931 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.25f));
932 lightSourceColour = moon->GetLightColour((0.75f - moonLightTreshold) / (1.0f - moonLightTreshold));
933 sunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(lightSourceColour.r, lightSourceColour.g, lightSourceColour.b), 0.0f));
ViewportList GetRegisteredViewports()
Definition SO3EnvironmentComponent.cpp:110
std::set< SViewPort * > ViewportList
Definition SO3EnvironmentComponent.h:48
SEnvironment * parentEnvironment
Definition SO3EnvironmentComponent.h:47
Definition SO3Environment.h:47
void _NotifyEnvironmentComponentUnRegisterRenderTarget(Ogre::Viewport *targetViewport)
Definition SO3Environment.cpp:460
void _NotifyEnvironmentComponentRegisterRenderTarget(Ogre::Viewport *targetViewport)
Definition SO3Environment.cpp:447
Definition SO3Moon.h:41
Ogre::SceneManager * GetOgreScenePointer()
Definition SO3Scene.cpp:449
Definition SO3Sky.h:126
void SetVolumetricDisplacement(const unsigned int &index, const Ogre::Real &newVolumetricDisplacement)
Definition SO3Sky.cpp:748
virtual void Update(const Ogre::Real &updateTime)
Definition SO3Sky.cpp:504
void SetHeightFromCloudCeiling(const unsigned int &index, const Ogre::Real &newHeightFromCloudCeiling)
Definition SO3Sky.cpp:693
void SetAttenuationDistance(const unsigned int &index, const Ogre::Real &newAttenuationDistance)
Definition SO3Sky.cpp:715
Ogre::Real GetAttenuationDetail(const unsigned int &index)
Definition SO3Sky.cpp:721
void SetHeightVolume(const unsigned int &index, const Ogre::Real &newHeightVolume)
Definition SO3Sky.cpp:737
void SetParameters(const unsigned int &index, const float &heightFromCloudCeiling, const float &scale, const float &attenuationDistance, const float &attenuationDetail, const float &heightVolume, const float &volumetricDisplacement)
Definition SO3Sky.cpp:676
void RemoveLayer(const unsigned int &index)
Definition SO3Sky.cpp:623
Ogre::Real GetHeightFromCloudCeiling(const unsigned int &index)
Definition SO3Sky.cpp:688
void SetScale(const unsigned int &index, const Ogre::Real &newScale)
Definition SO3Sky.cpp:704
std::vector< int > GetLayerIndexes()
Definition SO3Sky.cpp:655
void SetAttenuationDetail(const unsigned int &index, const Ogre::Real &newAttenuationDetail)
Definition SO3Sky.cpp:726
Ogre::Real GetAttenuationDistance(const unsigned int &index)
Definition SO3Sky.cpp:710
Ogre::Real GetVolumetricDisplacement(const unsigned int &index)
Definition SO3Sky.cpp:743
virtual void SetEnableImpl(const bool &enableComponent)
Definition SO3Sky.cpp:479
unsigned int AddLayer(const Ogre::Real &heightFromCloudCeiling=0.0f, const Ogre::Real &scale=0.001f, const Ogre::Real &distanceAttenuation=0.05f, const Ogre::Real &detailAttenuation=1.0f, const Ogre::Real &heightVolume=0.25f, const Ogre::Real &volumetricDisplacement=0.01f)
Definition SO3Sky.cpp:547
Ogre::Real GetHeightVolume(const unsigned int &index)
Definition SO3Sky.cpp:732
Ogre::Real GetScale(const unsigned int &index)
Definition SO3Sky.cpp:699
Definition SO3Sky.h:242
virtual void SetEnableImpl(const bool &enableComponent)
Definition SO3Sky.cpp:787
virtual void Update(const Ogre::Real &updateTime)
Definition SO3Sky.cpp:849
virtual void UnregisterCamera(Ogre::Camera *cam)
Definition SO3Sky.cpp:775
Definition SO3Sky.h:71
virtual void SetEnableImpl(const bool &enableComponent)
Definition SO3Sky.cpp:443
virtual void UnregisterCamera(Ogre::Camera *cam)
Definition SO3Sky.cpp:447
Definition SO3Sky.h:47
void AddLightning(const Ogre::Vector3 from, const Ogre::Vector3 dir, const Ogre::Real length)
Definition SO3Sky.cpp:405
virtual void UnregisterViewportImpl(SViewPort *viewport)
Definition SO3Sky.cpp:187
void SetAnimationSpeed(const float &animationSpeed)
Definition SO3Sky.cpp:337
void SetCloudCeiling(const float &newCloudCeiling)
Definition SO3Sky.cpp:347
virtual void UnregisterCameraImpl(Ogre::Camera *cam)
Definition SO3Sky.cpp:222
virtual void RegisterViewportImpl(SViewPort *viewport)
Definition SO3Sky.cpp:176
virtual void SetEnableImpl(const bool &enableComponent)
Definition SO3Sky.cpp:95
SkyComponent * GetComponent(const SkyComponentType &componentType)
Definition SO3Sky.cpp:304
@ SO3_SKY_COMPONENT_VOLUMETRIC_CLOUD
Definition SO3Sky.h:55
const Ogre::ColourValue GetLightColour(const float &level=1.0f) const
Definition SO3SkyLight.cpp:187
Definition SO3Sun.h:41
Definition SO3ViewPort.h:56
Ogre::Viewport * GetOgreViewPortPointer()
Definition SO3ViewPort.cpp:98
Definition SO3DataScol.h:38
Generated by 1.9.8