X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fviewer.hxx;h=7cd58adae583058a48911b57a9d553581ebba261;hb=01e0156b5dfd555ef6fad818e53b7cd474b04704;hp=965e8569a8a8cb3cdf8bb6829c482522f375908c;hpb=8b10bb12f59618a772ddcda93541ac45b3fd7246;p=flightgear.git diff --git a/src/Main/viewer.hxx b/src/Main/viewer.hxx index 965e8569a..7cd58adae 100644 --- a/src/Main/viewer.hxx +++ b/src/Main/viewer.hxx @@ -119,6 +119,7 @@ public: // orientation rotations listed below. This has the effect of the // eye moving around and "looking at" the object (model) from // different angles. + virtual SGVec3d getOffset_m () const { return _offset_m; } virtual double getXOffset_m () const { return _offset_m.x(); } virtual double getYOffset_m () const { return _offset_m.y(); } virtual double getZOffset_m () const { return _offset_m.z(); } @@ -201,6 +202,7 @@ public: const SGVec3d& get_view_pos() { if ( _dirty ) { recalc(); } return _absolute_view_pos; } const SGVec3d& getViewPosition() { if ( _dirty ) { recalc(); } return _absolute_view_pos; } const SGQuatd& getViewOrientation() { if ( _dirty ) { recalc(); } return mViewOrientation; } + const SGQuatd& getViewOrientationOffset() { if ( _dirty ) { recalc(); } return mViewOffsetOr; } ////////////////////////////////////////////////////////////////////// // Part 4: View and frustrum data setters and getters @@ -247,6 +249,7 @@ private: bool _dirty; SGQuatd mViewOrientation; + SGQuatd mViewOffsetOr; SGVec3d _absolute_view_pos; SGGeod _position; @@ -259,15 +262,10 @@ private: double _target_pitch_deg; double _target_heading_deg; - double _damp_sync; - double _damp_roll; - double _damp_pitch; - double _damp_heading; - - double _damped_roll_deg; - double _damped_pitch_deg; - double _damped_heading_deg; - + SGVec3d _dampTarget; ///< current target value we are damping towards + SGVec3d _dampOutput; ///< current output of damping filter + SGVec3d _dampFactor; ///< weighting of the damping filter + // Position offsets from FDM origin. The X axis is positive // out the tail, Y is out the right wing, and Z is positive up. // distance in meters @@ -325,8 +323,12 @@ private: void recalc (); void recalcLookFrom(); void recalcLookAt(); - void dampEyeData(double &roll_deg, double &pitch_deg, double &heading_deg); + void setDampTarget(double h, double p, double r); + void getDampOutput(double& roll, double& pitch, double& heading); + + void updateDampOutput(double dt); + // add to _heading_offset_deg inline void incHeadingOffset_deg( double amt ) { set_dirty();