예제 #1
0
void CVRCullVisitor::apply(osg::LightSource& node)
{
    // push the node's state.
    StateSet* node_state = node.getStateSet();
    if(node_state)
        pushStateSet(node_state);

    StateAttribute* light = node.getLight();
    if(light)
    {
        if(node.getReferenceFrame() == osg::LightSource::RELATIVE_RF)
        {
            RefMatrix& matrix = *getModelViewMatrix();
            addPositionedAttribute(&matrix,light);
        }
        else
        {
            // relative to absolute.
            addPositionedAttribute(0,light);
        }
    }

    handle_cull_callbacks_and_traverse(node);

    // pop the node's state off the geostate stack.    
    if(node_state)
        popStateSet();
}
예제 #2
0
void
FltExportVisitor::apply( osg::LightSource& node )
{
    _firstNode = false;
    ScopedStatePushPop guard( this, node.getStateSet() );

    writeLightSource( node );
    writeMatrix( node.getUserData() );
    writeComment( node );
    writePushTraverseWritePop( node );
}