]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/views.hxx
Mac portability changes.
[flightgear.git] / src / Main / views.hxx
index 332176bb3379b98cd9184eee535a919d1c7cc1c4..b15a47d9f4af2375cf6e8887243b26c05147d6cd 100644 (file)
 # error This library requires C++
 #endif                                   
 
+#include <Include/compiler.h>
+
+#include <list>
+
+#include <sg.h>                        // plib include
 
 #include <FDM/flight.hxx>
 #include <Math/mat3.h>
 
 #include "options.hxx"
 
+FG_USING_STD(list);
+
+
+class FGMat4Wrapper {
+public:
+    sgMat4 m;
+};
+
+typedef list < FGMat4Wrapper > sgMat4_list;
+typedef sgMat4_list::iterator sgMat4_list_iterator;
+typedef sgMat4_list::const_iterator const_sgMat4_list_iterator;
+
 
 // used in views.cxx and tilemgr.cxx
 #define USE_FAST_FOV_CLIP 
@@ -48,6 +65,12 @@ class FGView {
 
 public:
 
+    enum fgViewMode
+    {
+       FG_VIEW_FIRST_PERSON = 0,
+       FG_VIEW_FOLLOW  = 1
+    };
+
     // the current offset from forward for viewing
     double view_offset;
 
@@ -152,6 +175,15 @@ public:
     // Current model view matrix;
     GLfloat MODEL_VIEW[16];
 
+    // view mode
+    fgViewMode view_mode;
+
+    // sg versions of our friendly matrices
+    sgMat4 sgLOCAL, sgUP, sgVIEW_ROT, sgTRANS, sgVIEW, sgLARC_TO_SSG;
+
+    // queue of view matrices so we can have a follow view
+    sgMat4_list follow;
+
 public:
 
     // Constructor
@@ -187,6 +219,9 @@ public:
     // Update the field of view coefficients
     void UpdateFOV( const fgOPTIONS& o );
 
+    // Cycle view mode
+    void cycle_view_mode();
+
     // accessor functions
     inline double get_view_offset() const { return view_offset; }
     inline void set_view_offset( double a ) { view_offset = a; }