示例#1
0
void
ModelLayer::setLightingEnabled( bool value )
{
    _runtimeOptions.lightingEnabled() = value;

    for( NodeObserverSet::iterator i = _nodeSet.begin(); i != _nodeSet.end(); ++i )
    {
        if ( i->valid() )
        {
            i->get()->getOrCreateStateSet()->setMode( 
                GL_LIGHTING, value ? osg::StateAttribute::ON : 
                (osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED) );
        }
    }
}
示例#2
0
void
ModelLayer::setVisible(bool value)
{
    if ( _runtimeOptions.visible() != value )
    {
        _runtimeOptions.visible() = value;

        for( NodeObserverSet::iterator i = _nodeSet.begin(); i != _nodeSet.end(); ++i )
        {
            if ( i->valid() )
            {
                i->get()->setNodeMask( value ? ~0 : 0 );
            }
        }

        fireCallback( &ModelLayerCallback::onVisibleChanged );
    }
}