#include <simgear/math/point3d.hxx>
#include <simgear/misc/sg_path.hxx>
#include <simgear/scene/model/placementtrans.hxx>
-#include <simgear/structure/ssgSharedPtr.hxx>
+
+#include <osg/ref_ptr>
+#include <osg/Array>
+#include <osg/Group>
+#include <osg/LOD>
+#include <osg/MatrixTransform>
+#include <osg/Switch>
#if defined( sgi )
#include <strings.h>
typedef point_list::const_iterator const_point_list_iterator;
-class ssgLeaf;
-class ssgBranch;
-class ssgTransform;
-class ssgSelector;
-class ssgRangeSelector;
-class ssgVertexArray;
class FGTileEntry;
string model_path;
string texture_path;
FGTileEntry *tile;
- ssgSharedPtr<ssgTransform> obj_trans;
+ osg::ref_ptr<osg::MatrixTransform> obj_trans;
SGBucket bucket;
bool cache_obj;
inline FGDeferredModel() { }
inline FGDeferredModel( const string& mp, const string& tp, SGBucket b,
- FGTileEntry *t, ssgTransform *ot, bool co )
+ FGTileEntry *t, osg::MatrixTransform *ot, bool co )
{
model_path = mp;
texture_path = tp;
inline const SGBucket& get_bucket() const { return bucket; }
inline const bool get_cache_state() const { return cache_obj; }
inline FGTileEntry *get_tile() const { return tile; }
- inline ssgTransform *get_obj_trans() const { return obj_trans; }
+ inline osg::MatrixTransform *get_obj_trans() const { return obj_trans.get(); }
};
class FGTileEntry {
public:
-
- // global tile culling data
- Point3D center;
- double bounding_radius;
-
// this tile's official location in the world
SGBucket tile_bucket;
private:
- // ssg tree structure for this tile is as follows:
- // ssgRoot(scene)
- // - ssgBranch(terrain)
- // - ssgTransform(tile)
- // - ssgRangeSelector(tile)
- // - ssgEntity(tile)
- // - kid1(fan)
- // - kid2(fan)
- // ...
- // - kidn(fan)
-
// pointer to ssg transform for this tile
- ssgSharedPtr<ssgPlacementTransform> terra_transform;
- ssgSharedPtr<ssgPlacementTransform> vasi_lights_transform;
- ssgSharedPtr<ssgPlacementTransform> rwy_lights_transform;
- ssgSharedPtr<ssgPlacementTransform> taxi_lights_transform;
- ssgSharedPtr<ssgPlacementTransform> gnd_lights_transform;
+ osg::ref_ptr<osg::Group> terra_transform;
// pointer to ssg range selector for this tile
- ssgSharedPtr<ssgRangeSelector> terra_range;
- ssgSharedPtr<ssgRangeSelector> gnd_lights_range;
-
- // we create several preset brightness and can choose which one we
- // want based on lighting conditions.
- ssgSharedPtr<ssgSelector> gnd_lights_brightness;
-
- // we need to be able to turn runway lights on or off (doing this
- // via a call back would be nifty, but then the call back needs to
- // know about the higher level application's global state which is
- // a problem if we move the code into simgear.)
- ssgSharedPtr<ssgSelector> vasi_lights_selector;
- ssgSharedPtr<ssgSelector> rwy_lights_selector;
- ssgSharedPtr<ssgSelector> taxi_lights_selector;
+ osg::ref_ptr<osg::LOD> terra_range;
/**
* Indicates this tile has been loaded from a file and connected
volatile int pending_models;
bool obj_load( const string& path,
- ssgBranch* geometry,
- ssgBranch* vasi_lights,
- ssgBranch* rwy_lights,
- ssgBranch* taxi_lights,
- ssgVertexArray* gound_lights,
+ osg::Group* geometry,
bool is_base );
- ssgLeaf* gen_lights( SGMaterialLib *matlib, ssgVertexArray *lights,
- int inc, float bright );
-
double timestamp;
/**
// Update the ssg transform node for this tile so it can be
// properly drawn relative to our (0,0,0) point
- void prep_ssg_node( const Point3D& p, sgVec3 up, float vis);
+ void prep_ssg_node(float vis);
/**
* Load tile data from a file.
*/
inline const SGBucket& get_tile_bucket() const { return tile_bucket; }
- /**
- * Apply ssgLeaf::makeDList to all leaf of a branch
- */
- void makeDList( ssgBranch *b );
-
/**
* Add terrain mesh and ground lighting to scene graph.
*/
- void add_ssg_nodes( ssgBranch *terrain_branch,
- ssgBranch *gnd_lights_branch,
- ssgBranch *vasi_lights_branch,
- ssgBranch *rwy_lights_branch,
- ssgBranch *taxi_lights_branch );
+ void add_ssg_nodes( osg::Group *terrain_branch);
/**
* disconnect terrain mesh and ground lighting nodes from scene
/**
* return the SSG Transform node for the terrain
*/
- inline ssgPlacementTransform *get_terra_transform() const { return terra_transform; }
+ osg::Group *get_terra_transform() const { return terra_transform.get(); }
inline double get_timestamp() const { return timestamp; }
inline void set_timestamp( double time_ms ) { timestamp = time_ms; }