- inline double get_cur_elev() const { return cur_elev; }
- inline void set_cur_elev( double e ) { cur_elev = e; }
-
- inline Point3D get_center() const { return center; }
- inline void set_center( Point3D p ) { center = p; }
-
- inline Point3D get_next_center() const { return next_center; }
- inline void set_next_center( Point3D p ) { next_center = p; }
-
- inline void set_cur_radius( double r ) { cur_radius = r; }
- inline void set_cur_normal( sgdVec3 n ) { sgdCopyVec3( cur_normal, n ); }
-
- inline ssgRoot * get_scene_graph () const { return scene_graph; }
- inline void set_scene_graph (ssgRoot * s) { scene_graph = s; }
-
- inline ssgBranch * get_terrain_branch () const { return terrain_branch; }
- inline void set_terrain_branch (ssgBranch * t) { terrain_branch = t; }
-
- inline ssgBranch * get_gnd_lights_branch () const {
- return gnd_lights_branch;
- }
- inline void set_gnd_lights_branch (ssgBranch * t) {
- gnd_lights_branch = t;
- }
-
- inline ssgBranch * get_rwy_lights_branch () const {
- return rwy_lights_branch;
- }
- inline void set_rwy_lights_branch (ssgBranch * t) {
- rwy_lights_branch = t;
- }
-
- inline ssgBranch * get_models_branch () const {
- return models_branch;
- }
- inline void set_models_branch (ssgBranch * t) {
- models_branch = t;
- }
-
- inline ssgBranch * get_aircraft_branch () const {
- return aircraft_branch;
- }
- inline void set_aircraft_branch (ssgBranch * t) {
- aircraft_branch = t;
- }
-
- inline ssgRoot * get_lighting () const { return lighting; }
- inline void set_lighting (ssgRoot *l) { lighting = l; }
+ /// Compute the elevation of the scenery at geodetic latitude lat,
+ /// geodetic longitude lon and not higher than max_alt.
+ /// If the exact flag is set to true, the scenery center is moved to
+ /// gain a higher accuracy of that query. The center is restored past
+ /// that to the original value.
+ /// The altitude hit is returned in the alt argument.
+ /// The method returns true if the scenery is available for the given
+ /// lat/lon pair. If there is no scenery for that point, the altitude
+ /// value is undefined.
+ /// All values are meant to be in meters or degrees.
+ bool get_elevation_m(const SGGeod& geod, double& alt,
+ const SGMaterial** material,
+ const osg::Node* butNotFrom = 0);
+
+ /// Compute the elevation of the scenery beow the cartesian point pos.
+ /// you the returned scenery altitude is not higher than the position
+ /// pos plus an ofset given with max_altoff.
+ /// If the exact flag is set to true, the scenery center is moved to
+ /// gain a higher accuracy of that query. The center is restored past
+ /// that to the original value.
+ /// The altitude hit is returned in the alt argument.
+ /// The method returns true if the scenery is available for the given
+ /// lat/lon pair. If there is no scenery for that point, the altitude
+ /// value is undefined.
+ /// All values are meant to be in meters.
+ bool get_cart_elevation_m(const SGVec3d& pos, double max_altoff,
+ double& elevation, const SGMaterial** material,
+ const osg::Node* butNotFrom = 0);
+
+ /// Compute the nearest intersection point of the line starting from
+ /// start going in direction dir with the terrain.
+ /// The input and output values should be in cartesian coordinates in the
+ /// usual earth centered wgs84 coordiante system. Units are meters.
+ /// On success, true is returned.
+ bool get_cart_ground_intersection(const SGVec3d& start, const SGVec3d& dir,
+ SGVec3d& nearestHit,
+ const osg::Node* butNotFrom = 0);
+
+ osg::Group *get_scene_graph () const { return scene_graph.get(); }
+ osg::Group *get_terrain_branch () const { return terrain_branch.get(); }
+ osg::Group *get_models_branch () const { return models_branch.get(); }
+ osg::Group *get_aircraft_branch () const { return aircraft_branch.get(); }
+
+ /// Returns true if scenery is avaliable for the given lat, lon position
+ /// within a range of range_m.
+ /// lat and lon are expected to be in degrees.
+ bool scenery_available(const SGGeod& position, double range_m);
+
+ // Static because access to the pager is needed before the rest of
+ // the scenery is initialized.
+ static flightgear::SceneryPager* getPagerSingleton();