X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2Fmodel.hxx;h=bc48663acd0a16c467ac508496482d5949882ece;hb=4535c84b993fb9b6adecc9a699309b329f23c4ee;hp=08aa4bafb2e3b55e6697babce17ea2a0a36384be;hpb=625572663e47fb4d801a3f18e7f83971da5bb519;p=flightgear.git diff --git a/src/Model/model.hxx b/src/Model/model.hxx index 08aa4bafb..bc48663ac 100644 --- a/src/Model/model.hxx +++ b/src/Model/model.hxx @@ -14,7 +14,22 @@ SG_USING_STD(vector); -#include
+#include + + +// Don't pull in the headers, since we don't need them here. +class ssgBranch; +class ssgCutout; +class ssgEntity; +class ssgRangeSelector; +class ssgSelector; +class ssgTransform; + +class SGPropertyNode; +class SGInterpTable; +class FGCondition; +class FGLocation; + // Has anyone done anything *really* stupid, like making min and max macros? #ifdef min @@ -32,7 +47,7 @@ public: virtual ~FG3DModel (); virtual void init (const string &path); - virtual void update (int dt); + virtual void update (double dt); virtual bool getVisible () const; virtual void setVisible (bool visible); @@ -41,16 +56,24 @@ public: virtual double getLatitudeDeg () const { return _lat_deg; } virtual double getElevationFt () const { return _elev_ft; } + virtual void setLongitudeDeg (double lon_deg); + virtual void setLatitudeDeg (double lat_deg); + virtual void setElevationFt (double elev_ft); virtual void setPosition (double lon_deg, double lat_deg, double elev_ft); - virtual double getRoll () const { return _roll_deg; } - virtual double getPitch () const { return _pitch_deg; } - virtual double getHeading () const { return _heading_deg; } + virtual double getRollDeg () const { return _roll_deg; } + virtual double getPitchDeg () const { return _pitch_deg; } + virtual double getHeadingDeg () const { return _heading_deg; } + virtual void setRollDeg (double roll_deg); + virtual void setPitchDeg (double pitch_deg); + virtual void setHeadingDeg (double heading_deg); virtual void setOrientation (double roll_deg, double pitch_deg, double heading_deg); - virtual ssgEntity * getSceneGraph () const { return _selector; } + virtual ssgEntity * getSceneGraph () const { return (ssgEntity *)_selector; } + + virtual FGLocation * getFGLocation () const { return _location; } private: @@ -68,15 +91,16 @@ private: double _heading_deg; // Animations - vector _animations; - // Scene graph - ssgEntity * _model; + ssgBranch * _model; ssgSelector * _selector; ssgTransform * _position; + // Location + FGLocation * _location; + ////////////////////////////////////////////////////////////////////// @@ -106,9 +130,9 @@ private: /** * Update the animation. * - * @param dt The elapsed time in milliseconds since the last call. + * @param dt The elapsed time in seconds since the last call. */ - virtual void update (int dt) = 0; + virtual void update (double dt) = 0; }; @@ -122,11 +146,41 @@ private: NullAnimation (); virtual ~NullAnimation (); virtual void init (ssgEntity * object, SGPropertyNode * props); - virtual void update (int dt); + virtual void update (double dt); private: ssgBranch * _branch; }; + + /** + * A range, or level-of-detail (LOD) animation. + */ + class RangeAnimation : public Animation + { + public: + RangeAnimation (); + virtual ~RangeAnimation (); + virtual void init (ssgEntity * object, SGPropertyNode * props); + virtual void update (double dt); + private: + ssgRangeSelector * _branch; + }; + + + /** + * Animation to turn and face the screen. + */ + class BillboardAnimation : public Animation + { + public: + BillboardAnimation (); + virtual ~BillboardAnimation (); + virtual void init (ssgEntity * object, SGPropertyNode * props); + virtual void update (double dt); + private: + ssgCutout * _branch; + }; + /** * Animation to select alternative versions of the same object. @@ -137,7 +191,7 @@ private: SelectAnimation (); virtual ~SelectAnimation (); virtual void init (ssgEntity * object, SGPropertyNode * props); - virtual void update (int dt); + virtual void update (double dt); private: FGCondition * _condition; ssgSelector * _selector; @@ -155,7 +209,7 @@ private: SpinAnimation (); virtual ~SpinAnimation (); virtual void init (ssgEntity * object, SGPropertyNode * props); - virtual void update (int dt); + virtual void update (double dt); private: SGPropertyNode * _prop; double _factor; @@ -178,11 +232,12 @@ private: RotateAnimation (); virtual ~RotateAnimation (); virtual void init (ssgEntity * object, SGPropertyNode * props); - virtual void update (int dt); + virtual void update (double dt); private: SGPropertyNode * _prop; double _offset_deg; double _factor; + SGInterpTable * _table; bool _has_min; double _min_deg; bool _has_max; @@ -204,11 +259,12 @@ private: TranslateAnimation (); virtual ~TranslateAnimation (); virtual void init (ssgEntity * object, SGPropertyNode * props); - virtual void update (int dt); + virtual void update (double dt); private: SGPropertyNode * _prop; double _offset_m; double _factor; + SGInterpTable * _table; bool _has_min; double _min_m; bool _has_max; @@ -219,7 +275,10 @@ private: ssgTransform * _transform; }; + }; #endif // __MODEL_HXX + +