#include <iomanip>
#include <osg/ArgumentParser>
+#include <osg/Image>
#include <simgear/props/props.hxx>
#include <simgear/props/props_io.hxx>
#include <simgear/scene/model/BVHPageNodeOSG.hxx>
#include <simgear/scene/model/ModelRegistry.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
+#include <simgear/scene/util/OptionsReadFileCallback.hxx>
#include <simgear/scene/tgdb/userdata.hxx>
namespace sg = simgear;
sg::BVHPager& _pager;
};
+// Short circuit reading image files.
+class ReadFileCallback : public sg::OptionsReadFileCallback {
+public:
+ virtual ~ReadFileCallback()
+ { }
+
+ virtual osgDB::ReaderWriter::ReadResult readImage(const std::string& name, const osgDB::Options*)
+ { return new osg::Image; }
+};
+
static bool
intersect(sg::BVHNode& node, sg::BVHPager& pager,
const SGVec3d& start, SGVec3d& end, double offset)
options->getDatabasePathList());
options->setMaterialLib(ml);
options->setPropertyNode(props);
+ options->setReadFileCallback(new ReadFileCallback);
options->setPluginStringData("SimGear::FG_ROOT", fg_root);
// we do not need the builtin boundingvolumes
options->setPluginStringData("SimGear::BOUNDINGVOLUMES", "OFF");