FGGroundCache::GroundProperty oldGp = mGroundProperty;
if (!enterNode(geode))
return;
-
- for(unsigned i = 0; i < geode.getNumDrawables(); ++i)
+ unsigned int numDrawables = geode.getNumDrawables();
+ for(unsigned i = 0; i < numDrawables; ++i)
fillWith(geode.getDrawable(i));
sphIsec = oldSphIsec;
mGroundProperty = oldGp;
FGGroundCache::FGGroundCache() :
ground_radius(0.0),
+ _type(0),
+ _material(0),
cache_ref_time(0.0),
wire_id(0),
reference_wgs84_point(SGVec3d(0, 0, 0)),
reference_vehicle_radius(0.0),
- found_ground(false),
- _material(0)
+ down(0.0, 0.0, 0.0),
+ found_ground(false)
{
}
_node->setCullCallback(new TileCullCallback);
tileFileName += ".stg";
_node->setName(tileFileName);
+ // Give a default LOD range so that traversals that traverse
+ // active children (like the groundcache lookup) will work before
+ // tile manager has had a chance to update this node.
+ _node->setRange(0, 0.0, 10000.0);
}
|| osgDB::equalCaseInsensitive(extension, "stg"));
}
+//#define SLOW_PAGER 1
+#ifdef SLOW_PAGER
+#include <unistd.h>
+#endif
+
osgDB::ReaderWriter::ReadResult
ReaderWriterSTG::readNode(const string& fileName,
const osgDB::ReaderWriter::Options* options) const
osg::Node* result
= FGTileEntry::loadTileByName(osgDB::getNameLessExtension(stgFileName),
globals->get_fg_scenery());
+ // For debugging race conditions
+#ifdef SLOW_PAGER
+ sleep(5);
+#endif
if (result)
return result; // Constructor converts to ReadResult
else