+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <iostream>
#include <cstdlib>
{
try {
SGSharedPtr<SGPropertyNode> prop = new SGPropertyNode;
- return simgear::SGModelLib::loadModel(modelPath, prop);
+ return simgear::SGModelLib::loadModel(modelPath,
+ globals->get_props());
} catch (...) {
std::cerr << "Error loading \"" << modelPath << "\"" << std::endl;
return 0;
char filename[24];
static int count = 1;
- FGRenderer *renderer = globals->get_renderer();
-
while (count < 1000) {
FILE *fp;
snprintf(filename, 24, "fgviewer-%03d.osg", count++);
default:
return false;
}
+ return false;
}
void GraphDumpHandler::getUsage(osg::ApplicationUsage& usage) const
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->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.
SGReaderWriterBTGOptions* btgOptions = new SGReaderWriterBTGOptions;
btgOptions->getDatabasePathList() = filePathList;
btgOptions->setMatlib(globals->get_matlib());
+ btgOptions->setUseRandomObjects(fgGetBool("/sim/rendering/random-objects", false));
+ btgOptions->setUseRandomVegetation(fgGetBool("/sim/rendering/random-vegetation", false));
// read the scene from the list of file specified command line args.
osg::ref_ptr<osg::Node> loadedModel;