#endif
#include <vector>
-#include <plib/ssg.h>
SG_USING_STD(vector);
-#include <Main/fg_props.hxx>
-#include <Main/location.hxx>
+#include <plib/sg.h>
+
+
+// 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
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);
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; }
double _heading_deg;
// Animations
-
vector <Animation *> _animations;
-
// Scene graph
- ssgEntity * _model;
+ ssgBranch * _model;
ssgSelector * _selector;
ssgTransform * _position;
// Location
FGLocation * _location;
+
\f
//////////////////////////////////////////////////////////////////////
// Internal classes for individual animations.
/**
* 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;
};
NullAnimation ();
virtual ~NullAnimation ();
virtual void init (ssgEntity * object, SGPropertyNode * props);
- virtual void update (int dt);
+ virtual void update (double dt);
private:
ssgBranch * _branch;
};
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.
*/
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;
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;
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;
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;
ssgTransform * _transform;
};
+
};
#endif // __MODEL_HXX