00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OrbitEffect_Header
00009 #define OrbitEffect_Header
00010
00011 #include <DrawObj.H>
00012 #include <IS3D.H>
00013 #include "Word.H"
00014 #include "Effect.H"
00015
00016 using namespace std;
00017
00018 namespace cavewriting {
00019
00020 class OrbitEffect : public Effect {
00021
00022 public:
00023
00024 OrbitEffect(Word* word, double startTime = 0, double duration = 100,
00025 bool startPaused = false,
00026 const Vector3& initialPosition = Vector3(2, 2, 2),
00027 double radius = 1.0, double theta=0.0,
00028 double delta = 0.01, double height = 0.0);
00029
00030 virtual ~OrbitEffect();
00031
00032 virtual void animate();
00033 static void stopAll();
00034
00035 static OrbitEffect* createDefaultOrbitEffect(Word * word, bool startPaused = false);
00036
00037 CoordinateFrame getCFrameAtTheta(double theta);
00038 double getTheta() { return _theta; }
00039 void setTheta(double theta) { _theta = theta; }
00040
00041 protected:
00042
00043 Vector3 _positionOffset;
00044 double _radius;
00045 double _theta;
00046 bool _firstTime;
00047 double _delta;
00048 double _height;
00049 double _rotOffAxisX;
00050 double _rotOffAxisY;
00051 double _rotOffAxisZ;
00052
00053
00054 private:
00055 static bool _stopAll;
00056
00057 };
00058
00059 }
00060
00061 #endif