예제 #1
0
void SceneView::inheritCullSettings(const osg::CullSettings& settings, unsigned int inheritanceMask)
{
    if (_camera.valid() && _camera->getView()) 
    {
        if (inheritanceMask & osg::CullSettings::LIGHTING_MODE)
        {
            LightingMode newLightingMode = _lightingMode;
        
            switch(_camera->getView()->getLightingMode())
            {
                case(osg::View::NO_LIGHT): newLightingMode = NO_SCENEVIEW_LIGHT; break;
                case(osg::View::HEADLIGHT): newLightingMode = HEADLIGHT; break;
                case(osg::View::SKY_LIGHT): newLightingMode = SKY_LIGHT; break;
            }
            
            if (newLightingMode != _lightingMode)
            {
                setLightingMode(newLightingMode);
            }
        }
                
        if (inheritanceMask & osg::CullSettings::LIGHT)
        {
            setLight(_camera->getView()->getLight());
        }
    }
    
    osg::CullSettings::inheritCullSettings(settings, inheritanceMask);
}
예제 #2
0
OSGGTKDrawingArea::OSGGTKDrawingArea():
_widget   (gtk_drawing_area_new()),
_glconfig (0),
_context  (0),
_drawable (0),
_state    (0),
_queue    (*getEventQueue()) {
    setCameraManipulator(new osgGA::TrackballManipulator());
    setLightingMode(osg::View::HEADLIGHT);
}