Changed the main to create a Group and then add the loaded scene and HUD scene

into this.  This has been done to rework code nearer to what Stephan Huber
used to get round a crash under OSX when a model was passed in.  This crash
suggest a problem in dynamic_cast<> perhaps?
This commit is contained in:
Robert Osfield
2003-11-21 14:17:26 +00:00
parent f28783e22b
commit 9d883176f9

View File

@@ -201,14 +201,10 @@ int main( int argc, char **argv )
// read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
osg::ref_ptr<osg::Group> group = dynamic_cast<osg::Group*>(scene.get());
if (!group)
{
group = new osg::Group;
group->addChild(scene.get());
}
osg::ref_ptr<osg::Group> group = new osg::Group;
// add the HUD subgraph.
if (scene.valid()) group->addChild(scene.get());
group->addChild(createHUD());
// set the scene to render