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

@ -500,14 +500,20 @@ void SceneView::inheritCullSettings(const osg::CullSettings& settings, unsigned
{
if (_camera.valid() && _camera->getView())
{
switch(_camera->getView()->getLightingMode())
if (inheritanceMask & osg::CullSettings::LIGHTING_MODE)
{
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;
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;
}
}
if (inheritanceMask & osg::CullSettings::LIGHT)
{
setLight(_camera->getView()->getLight());
}
setLight(_camera->getView()->getLight());
}
osg::CullSettings::inheritCullSettings(settings, inheritanceMask);