mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
940 B
C++
36 lines
940 B
C++
11 years ago
|
|
||
|
#include "lightingday.hpp"
|
||
|
|
||
|
#include <OgreSceneManager.h>
|
||
|
|
||
|
CSVRender::LightingDay::LightingDay() : mSceneManager (0), mLight (0) {}
|
||
|
|
||
|
void CSVRender::LightingDay::activate (Ogre::SceneManager *sceneManager,
|
||
|
const Ogre::ColourValue *defaultAmbient)
|
||
|
{
|
||
|
mSceneManager = sceneManager;
|
||
|
|
||
|
if (defaultAmbient)
|
||
|
mSceneManager->setAmbientLight (*defaultAmbient);
|
||
|
else
|
||
|
mSceneManager->setAmbientLight (Ogre::ColourValue (0.7, 0.7, 0.7, 1));
|
||
|
|
||
|
mLight = mSceneManager->createLight();
|
||
|
mLight->setType (Ogre::Light::LT_DIRECTIONAL);
|
||
|
mLight->setDirection (Ogre::Vector3 (0, 0, -1));
|
||
|
mLight->setDiffuseColour (Ogre::ColourValue (1, 1, 1));
|
||
|
}
|
||
|
|
||
|
void CSVRender::LightingDay::deactivate()
|
||
|
{
|
||
|
if (mLight)
|
||
|
{
|
||
|
mSceneManager->destroyLight (mLight);
|
||
|
mLight = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void CSVRender::LightingDay::setDefaultAmbient (const Ogre::ColourValue& colour)
|
||
|
{
|
||
|
mSceneManager->setAmbientLight (colour);
|
||
|
}
|