add scene switch node

0.6.3
Miloslav Číž 7 years ago
parent 1a4f351e3d
commit 56c74fb96f

@ -205,7 +205,9 @@ namespace MWRender
mSceneRoot = sceneRoot;
sceneRoot->setStartLight(1);
mRootNode->addChild(sceneRoot);
mSceneSwitch = new osg::Switch;
mSceneSwitch->addChild(sceneRoot);
mRootNode->addChild(mSceneSwitch);
mPathgrid.reset(new Pathgrid(mRootNode));
@ -815,12 +817,15 @@ namespace MWRender
// so out of order calls are necessary to get a correct frameNumber for the next frame.
// refer to the advance() and frame() order in Engine::go()
mSceneSwitch->setAllChildrenOff(); // don't render the scene for main camera
mViewer->eventTraversal();
mViewer->updateTraversal();
mViewer->renderingTraversals();
callback->waitTillDone();
mSceneSwitch->setAllChildrenOn();
mViewer->getCamera()->setClearMask(maskBackup);
mViewer->getCamera()->setClearDepth(clearDepthBackup);

@ -224,6 +224,7 @@ namespace MWRender
osg::ref_ptr<osgViewer::Viewer> mViewer;
osg::ref_ptr<osg::Group> mRootNode;
osg::ref_ptr<osg::Group> mSceneRoot;
osg::ref_ptr<osg::Switch> mSceneSwitch;
Resource::ResourceSystem* mResourceSystem;
osg::ref_ptr<SceneUtil::WorkQueue> mWorkQueue;

Loading…
Cancel
Save