- inline void prep_ssg_node( const Point3D& p, float vis) {
- SetOffset( p );
-
-// #define USE_UP_AND_COMING_PLIB_FEATURE
-#ifdef USE_UP_AND_COMING_PLIB_FEATURE
- range_ptr->setRange( 0, SG_ZERO );
- range_ptr->setRange( 1, vis + bounding_radius );
-#else
- float ranges[2];
- ranges[0] = SG_ZERO;
- ranges[1] = vis + bounding_radius;
- range_ptr->setRanges( ranges, 2 );
-#endif
- sgVec3 sgTrans;
- sgSetVec3( sgTrans, offset.x(), offset.y(), offset.z() );
- transform_ptr->setTransform( sgTrans );
- }
+ void prep_ssg_node( const Point3D& p, sgVec3 up, float vis);
+
+ /**
+ * Load tile data from a file.
+ * @param base name of directory containing tile data file.
+ * @param is_base is this a base terrain object for which we should generate
+ * random ground light points */
+ void load( const SGPath& base, bool is_base );
+
+ /**
+ * Return true if the tile entry is loaded, otherwise return false
+ * indicating that the loading thread is still working on this.
+ */
+ inline bool is_loaded() const { return loaded; }
+
+ /**
+ * decrement the pending models count
+ */
+ inline void dec_pending_models() { pending_models--; }
+
+ /**
+ * return the number of remaining pending models for this tile
+ */
+ inline int get_pending_models() const { return pending_models; }
+
+ /**
+ * Return the "bucket" for this tile
+ */
+ inline SGBucket get_tile_bucket() const { return tile_bucket; }
+
+ /**
+ * Add terrain mesh and ground lighting to scene graph.
+ */
+ void add_ssg_nodes( ssgBranch* terrain_branch,
+ ssgBranch* gnd_lights_branch,
+ ssgBranch* rwy_lights_branch );
+
+ /**
+ * disconnect terrain mesh and ground lighting nodes from scene
+ * graph for this tile.
+ */
+ void disconnect_ssg_nodes();
+
+
+ /**
+ * return the SSG Transform node for the terrain
+ */
+ inline ssgTransform *get_terra_transform() { return terra_transform; }
+
+ void set_timestamp(double time_ms) { timestamp = time_ms; }
+
+ inline double get_timestamp() const { return timestamp; }