Added CullSettings inheritance mask for LIGHTING_MODE and LIGHT

This commit is contained in:
Robert Osfield 2007-05-08 10:02:07 +00:00
parent 963cd837e3
commit 5b9883516a
2 changed files with 14 additions and 6 deletions

View File

@ -71,6 +71,8 @@ class OSG_EXPORT CullSettings
CULL_MASK_LEFT = 0x0800,
CULL_MASK_RIGHT = 0x1000,
CLEAR_COLOR = 0x2000,
LIGHTING_MODE = 0x4000,
LIGHT = 0x8000,
NO_VARIABLES = 0x0000,
ALL_VARIABLES = 0xFFFF

View File

@ -499,6 +499,8 @@ osg::Matrixd SceneView::computeRightEyeViewImplementation(const osg::Matrixd& vi
void SceneView::inheritCullSettings(const osg::CullSettings& settings, unsigned int inheritanceMask)
{
if (_camera.valid() && _camera->getView())
{
if (inheritanceMask & osg::CullSettings::LIGHTING_MODE)
{
switch(_camera->getView()->getLightingMode())
{
@ -506,9 +508,13 @@ void SceneView::inheritCullSettings(const osg::CullSettings& settings, unsigned
case(osg::View::HEADLIGHT): setLightingMode(HEADLIGHT); break;
case(osg::View::SKY_LIGHT): setLightingMode(SKY_LIGHT); break;
}
}
if (inheritanceMask & osg::CullSettings::LIGHT)
{
setLight(_camera->getView()->getLight());
}
}
osg::CullSettings::inheritCullSettings(settings, inheritanceMask);
}