Added s/getLightingMode and s/getLight to osg::View to allow control of the viewers

global light source.
This commit is contained in:
Robert Osfield
2007-05-07 22:07:23 +00:00
parent 6716f0d845
commit 963cd837e3
8 changed files with 123 additions and 6 deletions

View File

@@ -496,6 +496,24 @@ osg::Matrixd SceneView::computeRightEyeViewImplementation(const osg::Matrixd& vi
-es,0.0,0.0,1.0);
}
void SceneView::inheritCullSettings(const osg::CullSettings& settings, unsigned int inheritanceMask)
{
if (_camera.valid() && _camera->getView())
{
switch(_camera->getView()->getLightingMode())
{
case(osg::View::NO_LIGHT): setLightingMode(NO_SCENEVIEW_LIGHT); break;
case(osg::View::HEADLIGHT): setLightingMode(HEADLIGHT); break;
case(osg::View::SKY_LIGHT): setLightingMode(SKY_LIGHT); break;
}
setLight(_camera->getView()->getLight());
}
osg::CullSettings::inheritCullSettings(settings, inheritanceMask);
}
void SceneView::cull()
{
_dynamicObjectCount = 0;