]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/views.hxx
Added some early support for a cheezy external view of TuX.
[flightgear.git] / src / Main / views.hxx
index 378bf587617e1695353ce4c4c98fd0aaf57cc8da..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 "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 
@@ -49,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;
 
@@ -153,7 +175,14 @@ public:
     // Current model view matrix;
     GLfloat MODEL_VIEW[16];
 
-    sgMat4 sgLOCAL, sgUP, sgVIEW, sgLARC_TO_SSG;
+    // 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:
 
@@ -190,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; }