- /**
- * Initialize the animation.
- *
- * @param object The object to animate.
- * @param props The property node with configuration information.
- */
- virtual void init (ssgEntity * object, SGPropertyNode * props) = 0;
-
-
- /**
- * Update the animation.
- *
- * @param dt The elapsed time in seconds since the last call.
- */
- virtual void update (double dt) = 0;
-
- };
-
-
- /**
- * A no-op animation.
- */
- class NullAnimation : public Animation
- {
- public:
- NullAnimation ();
- virtual ~NullAnimation ();
- virtual void init (ssgEntity * object, SGPropertyNode * props);
- 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.
- */
- class SelectAnimation : public Animation
- {
- public:
- SelectAnimation ();
- virtual ~SelectAnimation ();
- virtual void init (ssgEntity * object, SGPropertyNode * props);
- virtual void update (double dt);
- private:
- FGCondition * _condition;
- ssgSelector * _selector;
- };
-
-
- /**
- * Animation to spin an object around a center point.
- *
- * This animation rotates at a specific velocity.
- */
- class SpinAnimation : public Animation
- {
- public:
- SpinAnimation ();
- virtual ~SpinAnimation ();
- virtual void init (ssgEntity * object, SGPropertyNode * props);
- virtual void update (double dt);
- private:
- SGPropertyNode * _prop;
- double _factor;
- double _position_deg;
- sgMat4 _matrix;
- sgVec3 _center;
- sgVec3 _axis;
- ssgTransform * _transform;
- };
-
-
- /**
- * Animation to rotate an object around a center point.
- *
- * This animation rotates to a specific position.
- */
- class RotateAnimation : public Animation
- {
- public:
- RotateAnimation ();
- virtual ~RotateAnimation ();
- virtual void init (ssgEntity * object, SGPropertyNode * props);
- virtual void update (double dt);
- private:
- SGPropertyNode * _prop;
- double _offset_deg;
- double _factor;
- SGInterpTable * _table;
- bool _has_min;
- double _min_deg;
- bool _has_max;
- double _max_deg;
- double _position_deg;
- sgMat4 _matrix;
- sgVec3 _center;
- sgVec3 _axis;
- ssgTransform * _transform;
- };
-
-
- /**
- * Animation to slide along an axis.
- */
- class TranslateAnimation : public Animation
- {
- public:
- TranslateAnimation ();
- virtual ~TranslateAnimation ();
- virtual void init (ssgEntity * object, SGPropertyNode * props);
- virtual void update (double dt);
- private:
- SGPropertyNode * _prop;
- double _offset_m;
- double _factor;
- SGInterpTable * _table;
- bool _has_min;
- double _min_m;
- bool _has_max;
- double _max_m;
- double _position_m;
- sgMat4 _matrix;
- sgVec3 _axis;
- ssgTransform * _transform;
- };
-
-
-};