2014-03-26 18:29:15 +01:00
|
|
|
|
|
|
|
#include "lightingbright.hpp"
|
|
|
|
|
|
|
|
#include <OgreSceneManager.h>
|
|
|
|
|
2015-03-28 20:15:17 +01:00
|
|
|
#include <osgViewer/View>
|
2014-03-26 18:29:15 +01:00
|
|
|
|
2015-03-28 20:15:17 +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
|
|
|
{
|
2015-03-28 20:15:17 +01:00
|
|
|
mView = view;
|
|
|
|
|
|
|
|
// FIXME: ambient should be applied to LightModel instead of the light
|
2014-03-26 18:29:15 +01:00
|
|
|
|
2015-03-28 20:15:17 +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
|
|
|
|
2015-03-28 20:15:17 +01:00
|
|
|
mView->setLight(light);
|
2014-03-26 18:29:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVRender::LightingBright::deactivate()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-28 20:15:17 +01:00
|
|
|
void CSVRender::LightingBright::setDefaultAmbient (const osg::Vec4f& colour) {}
|