Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

direct/src/deadrec/correction.h

Go to the documentation of this file.
00001 // Filename: correction.h
00002 // Created by:  cary (20Dec00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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 /* __CORRECTION_H__ */

Generated on Fri May 2 01:37:11 2003 for Direct by doxygen1.3