CompositeViewer support: Difference between revisions

Jump to navigation Jump to search
m
remove obsolete portion
No edit summary
m (remove obsolete portion)
Line 35: Line 35:
}}
}}


{{FGCquote
 
  |The splash init routine seems to contain other init, code too - see: {{flightgear source|commit=b485fa|path=src/Viewer/renderer.cxx|line=432}}. This is also where you can see that CompositeViewer isn't currently being used at all.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=231949#p231949
    |title=<nowiki>Re: How to create 2 master camera and 2 views  in flightgear</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Thu Feb 12</nowiki>
  }}
}}
<syntaxhighlight lang="cpp" line start="435" highlight="449" enclose="div">
void
FGRenderer::splashinit( void )
{
    // important that we reset the viewer sceneData here, to ensure the reference
    // time for everything is in sync; otherwise on reset the Viewer and
    // GraphicsWindow clocks are out of sync.
    osgViewer::Viewer* viewer = getViewer();
    viewer->setName("osgViewer");
    _viewerSceneRoot = new osg::Group;
    _viewerSceneRoot->setName("viewerSceneRoot");
    viewer->setSceneData(_viewerSceneRoot);
   
    ref_ptr<Node> splashNode = fgCreateSplashNode();
    if (_classicalRenderer) {
        _viewerSceneRoot->addChild(splashNode.get());
    } else {
        for (  CameraGroup::CameraIterator ii = CameraGroup::getDefault()->camerasBegin();
                ii != CameraGroup::getDefault()->camerasEnd();
                ++ii )
        {
            CameraInfo* info = ii->get();
            Camera* camera = info->getCamera(DISPLAY_CAMERA);
            if (camera == 0) continue;
            camera->addChild(splashNode.get());
        }
    }
   
    _frameStamp = new osg::FrameStamp;
    viewer->setFrameStamp(_frameStamp.get());
    // Scene doesn't seem to pass the frame stamp to the update
    // visitor automatically.
    _updateVisitor->setFrameStamp(_frameStamp.get());
    viewer->setUpdateVisitor(_updateVisitor.get());
    fgSetDouble("/sim/startup/splash-alpha", 1.0);
}
</syntaxhighlight>
== Cameras ==
== Cameras ==
{{PatchAvailable|url=https://forum.flightgear.org/viewtopic.php?f=71&t=23929#p317448}}
{{PatchAvailable|url=https://forum.flightgear.org/viewtopic.php?f=71&t=23929#p317448}}

Navigation menu