]> 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 e0ac783969ab2d3e75424ef2804f89d9d4d652c9..b3aad326ea1462b4b1f0a9e5c34bfc18f151edea 100644 (file)
@@ -1,9 +1,24 @@
 // location.hxx -- class for determining model location in the flightgear world.
 //
-// Written by Jim Wilson,  David Megginson, started April 2002.
-//                          overhaul started October 2000.
+// Written by Jim Wilson, David Megginson, started April 2002.
 //
-// This file is in the Public Domain, and comes with no warranty.
+// Copyright (C) 2002  Jim Wilson, David Megginson
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
 
 
 #ifndef _LOCATION_HXX
@@ -16,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
 
@@ -91,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:
@@ -120,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;
 
@@ -148,16 +183,3 @@ private:
 
 
 #endif // _LOCATION_HXX
-
-
-
-
-
-
-
-
-
-
-
-
-