]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/location.hxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Main / location.hxx
index d6d1b5ef89d3bc222139e754c310ab915b1058d5..b3aad326ea1462b4b1f0a9e5c34bfc18f151edea 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <simgear/compiler.h>
 #include <simgear/constants.h>
+#include <simgear/bucket/newbucket.hxx>
+#include <simgear/math/point3d.hxx>
 
 #include <plib/sg.h>           // plib include
 
@@ -106,12 +108,22 @@ public:
     virtual float *get_surface_east() {        return _surface_east; }
     // Get surface south vector
     virtual float *get_surface_south() { return _surface_south; }
+    // Elevation of ground under location (based on scenery output)...
+    void set_cur_elev_m ( double elev ) { _cur_elev_m = elev; }
+    inline double get_cur_elev_m () { return _cur_elev_m; }
+    // Interface to current buckets for use with tilemgr...
+    void set_current_bucket ( SGBucket current_bucket ) { _current_bucket = current_bucket; }
+    inline SGBucket get_current_bucket () { return _current_bucket; }
+    void set_previous_bucket ( SGBucket previous_bucket ) { _previous_bucket = previous_bucket; }
+    inline SGBucket get_previous_bucket () { return _previous_bucket; }
+    void set_tile_center ( Point3D tile_center ) { _tile_center = tile_center; }
+    inline Point3D get_tile_center () { return _tile_center; }
 
     // Matrices...
-    virtual const sgMat4 &getTransformMatrix() { if ( _dirty ) { recalc(); }   return TRANS; }
-    virtual const sgMat4 &getCachedTransformMatrix() { return TRANS; }
-    virtual const sgMat4 &getUpMatrix()  { if ( _dirty ) { recalc(); } return UP; }
-    virtual const sgMat4 &getCachedUpMatrix()  { return UP; }
+    virtual const sgVec4 * getTransformMatrix() { if ( _dirty ) { recalc(); }  return TRANS; }
+    virtual const sgVec4 * getCachedTransformMatrix() { return TRANS; }
+    virtual const sgVec4 * getUpMatrix()  { if ( _dirty ) { recalc(); }        return UP; }
+    virtual const sgVec4 * getCachedUpMatrix()  { return UP; }
 
 
 private:
@@ -135,6 +147,14 @@ private:
     double _pitch_deg;
     double _heading_deg;
 
+    // elevation of ground under this location...
+    double _cur_elev_m;
+    // current and previous scenery buckets to be saved for use in
+    // getting current elevation from tilemgr.
+    SGBucket _previous_bucket;
+    SGBucket _current_bucket;
+    Point3D _tile_center;
+
     // surface vector heading south
     sgVec3 _surface_south;
 
@@ -163,16 +183,3 @@ private:
 
 
 #endif // _LOCATION_HXX
-
-
-
-
-
-
-
-
-
-
-
-
-