00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CORRECTION_H__
00020 #define __CORRECTION_H__
00021
00022 #include <directbase.h>
00023 #include <luse.h>
00024
00025 class Correction {
00026 protected:
00027 LPoint3f _curr_p;
00028 LVector3f _curr_v;
00029 PUBLISHED:
00030 Correction(LPoint3f&, LVector3f&);
00031 virtual ~Correction(void);
00032
00033 virtual void step(void);
00034 virtual void new_target(LPoint3f&, LVector3f&);
00035 virtual void force_target(LPoint3f&, LVector3f&);
00036
00037 LPoint3f get_pos(void) const;
00038 LVector3f get_vel(void) const;
00039 };
00040
00041 class PopCorrection : public Correction {
00042 PUBLISHED:
00043 PopCorrection(LPoint3f&, LVector3f&);
00044 virtual ~PopCorrection(void);
00045
00046 virtual void step(void);
00047 virtual void new_target(LPoint3f&, LVector3f&);
00048 virtual void force_target(LPoint3f&, LVector3f&);
00049 };
00050
00051 class LerpCorrection : public Correction {
00052 private:
00053 LPoint3f prev_p, save_p;
00054 bool have_both;
00055 float time;
00056 float dur;
00057 PUBLISHED:
00058 LerpCorrection(LPoint3f&, LVector3f&);
00059 virtual ~LerpCorrection(void);
00060
00061 virtual void step(void);
00062 virtual void new_target(LPoint3f&, LVector3f&);
00063 virtual void force_target(LPoint3f&, LVector3f&);
00064
00065 void set_duration(float);
00066 float get_duration(void) const;
00067 };
00068
00069 class SplineCorrection : public Correction {
00070 private:
00071 LPoint3f A, B, C, D;
00072 bool have_both;
00073 LPoint3f prev_p, save_p;
00074 LVector3f prev_v, save_v;
00075 float time;
00076 float dur;
00077 PUBLISHED:
00078 SplineCorrection(LPoint3f&, LVector3f&);
00079 virtual ~SplineCorrection(void);
00080
00081 virtual void step(void);
00082 virtual void new_target(LPoint3f&, LVector3f&);
00083 virtual void force_target(LPoint3f&, LVector3f&);
00084
00085 void set_duration(float);
00086 float get_duration(void) const;
00087 };
00088
00089 #endif