MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / createAtmosphere

Method createAtmosphere

Samples/2.0/Common/src/GraphicsSystem.cpp:893–918  ·  view source on GitHub ↗

-----------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

891 void GraphicsSystem::initMiscParamsListener( Ogre::NameValuePairList &params ) {}
892 //-----------------------------------------------------------------------------------
893 void GraphicsSystem::createAtmosphere( Ogre::Light *sunLight )
894 {
895#ifdef OGRE_BUILD_COMPONENT_ATMOSPHERE
896 {
897 Ogre::AtmosphereComponent *atmosphere = mSceneManager->getAtmosphereRaw();
898 OGRE_DELETE atmosphere;
899 }
900
901 Ogre::AtmosphereNpr *atmosphere =
902 OGRE_NEW Ogre::AtmosphereNpr( mRoot->getRenderSystem()->getVaoManager() );
903
904 {
905 // Preserve the Power Scale explicitly set by the sample
906 Ogre::AtmosphereNpr::Preset preset = atmosphere->getPreset();
907 preset.linkedLightPower = sunLight->getPowerScale();
908 atmosphere->setPreset( preset );
909 }
910
911 atmosphere->setSunDir(
912 sunLight->getDirection(),
913 std::asin( Ogre::Math::Clamp( -sunLight->getDirection().y, -1.0f, 1.0f ) ) /
914 Ogre::Math::PI );
915 atmosphere->setLight( sunLight );
916 atmosphere->setSky( mSceneManager, true );
917#endif
918 }
919 //-----------------------------------------------------------------------------------
920 void GraphicsSystem::setAlwaysAskForConfig( bool alwaysAskForConfig )
921 {

Callers 3

createScene01Method · 0.80
createScene01Method · 0.80
switchPresetMethod · 0.80

Calls 9

ClampFunction · 0.85
getAtmosphereRawMethod · 0.80
getVaoManagerMethod · 0.80
setPresetMethod · 0.80
setSunDirMethod · 0.80
setLightMethod · 0.80
getRenderSystemMethod · 0.45
getDirectionMethod · 0.45
setSkyMethod · 0.45

Tested by

no test coverage detected