]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/model.hxx
Solve for the elevator control input during approach. It turns out that
[flightgear.git] / src / Model / model.hxx
index 82f7891c4db4249518f0e719bf56d18a67adb1ee..bc48663acd0a16c467ac508496482d5949882ece 100644 (file)
@@ -18,6 +18,8 @@ SG_USING_STD(vector);
 
 
 // Don't pull in the headers, since we don't need them here.
+class ssgBranch;
+class ssgCutout;
 class ssgEntity;
 class ssgRangeSelector;
 class ssgSelector;
@@ -45,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);
@@ -89,12 +91,10 @@ private:
   double _heading_deg;
 
                                // Animations
-
   vector <Animation *> _animations;
 
-
                                // Scene graph
-  ssgEntity * _model;
+  ssgBranch * _model;
   ssgSelector * _selector;
   ssgTransform * _position;
 
@@ -130,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;
 
   };
 
@@ -146,7 +146,7 @@ private:
     NullAnimation ();
     virtual ~NullAnimation ();
     virtual void init (ssgEntity * object, SGPropertyNode * props);
-    virtual void update (int dt);
+    virtual void update (double dt);
   private:
     ssgBranch * _branch;
   };
@@ -161,12 +161,27 @@ private:
     RangeAnimation ();
     virtual ~RangeAnimation ();
     virtual void init (ssgEntity * object, SGPropertyNode * props);
-    virtual void update (int dt);
+    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.
    */
@@ -176,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;
@@ -194,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;
@@ -217,7 +232,7 @@ 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;
@@ -244,7 +259,7 @@ 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;
@@ -260,6 +275,7 @@ private:
     ssgTransform * _transform;
   };
 
+
 };
 
 #endif // __MODEL_HXX