osgGA::KeySwitchMatrixManipulator* keyswitchManipulator;
keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
- osgGA::MatrixManipulator* mm = new osgGA::TrackballManipulator;
- keyswitchManipulator->addMatrixManipulator('1', "Trackball", mm);
- mm = new osgGA::FlightManipulator;
- keyswitchManipulator->addMatrixManipulator('2', "Flight", mm);
- mm = new osgGA::DriveManipulator;
- keyswitchManipulator->addMatrixManipulator('3', "Drive", mm);
- mm = new osgGA::TerrainManipulator;
- keyswitchManipulator->addMatrixManipulator('4', "Terrain", mm);
-
+ keyswitchManipulator->addMatrixManipulator('1', "Trackball",
+ new osgGA::TrackballManipulator);
+ keyswitchManipulator->addMatrixManipulator('2', "Flight",
+ new osgGA::FlightManipulator);
+ keyswitchManipulator->addMatrixManipulator('3', "Drive",
+ new osgGA::DriveManipulator);
+ keyswitchManipulator->addMatrixManipulator('4', "Terrain",
+ new osgGA::TerrainManipulator);
viewer.setCameraManipulator(keyswitchManipulator);
// Usefull stats
globals = new FGGlobals;
- fgInitFGRoot(arguments.argc(), arguments.argv());
if ( !fgInitConfig(arguments.argc(), arguments.argv()) ) {
SG_LOG( SG_GENERAL, SG_ALERT, "Config option parsing failed ..." );
exit(-1);
}
globals->set_matlib( new SGMaterialLib );
- simgear::SGModelLib::init(globals->get_fg_root());
+ simgear::SGModelLib::init(globals->get_fg_root(), globals->get_props());
// Initialize the material property subsystem.
SGPath mpath( globals->get_fg_root() );
- mpath.append( "materials.xml" );
+ mpath.append( fgGetString("/sim/rendering/materials-file") );
if ( ! globals->get_matlib()->load(globals->get_fg_root(), mpath.str(),
globals->get_props()) ) {
- SG_LOG( SG_GENERAL, SG_ALERT, "Error loading material lib!" );
+ SG_LOG( SG_GENERAL, SG_ALERT,
+ "Error loading materials file " << mpath.str() );
exit(-1);
}