#include <sg.h> // plib include
#include <FDM/flight.hxx>
-#include <Math/mat3.h>
#include <Math/point3d.hxx>
#include <Time/fg_time.hxx>
#include <Time/light.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
// view position translated to scenery.center
Point3D view_pos;
+ // pilot offset from center of gravity. The X axis is positive
+ // out the tail, Y is out the right wing, and Z is positive up.
+ // Distances in meters of course.
+ sgVec3 pilot_offset;
+
// cartesion coordinates of current lon/lat if at sea level
// translated to scenery.center
Point3D cur_zero_elev;
// up vector for the view (usually point straight up through the
// top of the aircraft
- MAT3vec view_up;
- sgVec3 sgview_up;
+ sgVec3 view_up;
// the vector pointing straight out the nose of the aircraft
- MAT3vec view_forward;
+ sgVec3 view_forward;
// Transformation matrix for eye coordinates to aircraft coordinates
- MAT3mat AIRCRAFT;
+ // sgMat4 AIRCRAFT;
// Transformation matrix for the view direction offset relative to
// the AIRCRAFT matrix
- MAT3mat VIEW_OFFSET;
- sgMat4 sgVIEW_OFFSET;
+ sgMat4 VIEW_OFFSET;
// Current model view matrix;
GLfloat MODEL_VIEW[16];
// 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;
+ sgMat4 LOCAL, UP, VIEW_ROT, TRANS, VIEW, LARC_TO_SSG;
public:
inline void set_tris_culled( int tris) { tris_culled = tris; }
inline Point3D get_abs_view_pos() const { return abs_view_pos; }
inline Point3D get_view_pos() const { return view_pos; }
+ inline float *get_pilot_offset() { return pilot_offset; }
+ inline void set_pilot_offset( float x, float y, float z ) {
+ sgSetVec3( pilot_offset, x, y, z );
+ }
inline Point3D get_cur_zero_elev() const { return cur_zero_elev; }
inline float *get_to_sun() { return to_sun; }
- inline void set_to_sun( float x, float y, float z) {
+ inline void set_to_sun( float x, float y, float z ) {
sgSetVec3( to_sun, x, y, z );
}
inline float *get_surface_to_sun() { return surface_to_sun; }
inline float *get_surface_south() { return surface_south; }
inline float *get_surface_east() { return surface_east; }
inline float *get_local_up() { return local_up; }
- inline double *get_view_forward() { return view_forward; }
+ inline float *get_view_forward() { return view_forward; }
inline GLfloat *get_MODEL_VIEW() { return MODEL_VIEW; }
};