1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/opencs/view/render/lightingbright.cpp

31 lines
771 B
C++
Raw Normal View History

2014-03-26 18:29:15 +01:00
#include "lightingbright.hpp"
#include <OgreSceneManager.h>
#include <osgViewer/View>
2014-03-26 18:29:15 +01:00
CSVRender::LightingBright::LightingBright() : mView(NULL) {}
void CSVRender::LightingBright::activate (osgViewer::View* view,
const osg::Vec4f* /*defaultAmbient*/)
2014-03-26 18:29:15 +01:00
{
mView = view;
// FIXME: ambient should be applied to LightModel instead of the light
2014-03-26 18:29:15 +01:00
osg::ref_ptr<osg::Light> light (new osg::Light);
light->setConstantAttenuation(1.f);
light->setDirection(osg::Vec3f(0.f, 0.f, -1.f));
light->setDiffuse(osg::Vec4f(1.f, 1.f, 1.f, 1.f));
light->setAmbient(osg::Vec4f(1.f, 1.f, 1.f, 1.f));
2014-03-26 18:29:15 +01:00
mView->setLight(light);
2014-03-26 18:29:15 +01:00
}
void CSVRender::LightingBright::deactivate()
{
}
void CSVRender::LightingBright::setDefaultAmbient (const osg::Vec4f& colour) {}