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

direct/src/interval/cLerpInterval.h

Go to the documentation of this file.
00001 // Filename: cLerpInterval.h
00002 // Created by:  drose (27Aug02)
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 CLERPINTERVAL_H
00020 #define CLERPINTERVAL_H
00021 
00022 #include "directbase.h"
00023 #include "cInterval.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : CLerpInterval
00027 // Description : The base class for a family of intervals that
00028 //               linearly interpolate one or more numeric values over
00029 //               time.
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_DIRECT CLerpInterval : public CInterval {
00032 PUBLISHED:
00033   enum BlendType {
00034     BT_no_blend,
00035     BT_ease_in,
00036     BT_ease_out,
00037     BT_ease_in_out,
00038     BT_invalid
00039   };
00040 
00041 public:
00042   INLINE CLerpInterval(const string &name, double duration, 
00043                        BlendType blend_type);
00044 
00045 PUBLISHED:
00046   INLINE BlendType get_blend_type() const;
00047 
00048   static BlendType string_blend_type(const string &blend_type);
00049 
00050 protected:
00051   double compute_delta(double t) const;
00052 
00053 private:
00054   BlendType _blend_type;
00055 
00056   
00057 public:
00058   static TypeHandle get_class_type() {
00059     return _type_handle;
00060   }
00061   static void init_type() {
00062     CInterval::init_type();
00063     register_type(_type_handle, "CLerpInterval",
00064                   CInterval::get_class_type());
00065   }
00066   virtual TypeHandle get_type() const {
00067     return get_class_type();
00068   }
00069   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00070 
00071 private:
00072   static TypeHandle _type_handle;
00073 };
00074 
00075 #include "cLerpInterval.I"
00076 
00077 #endif
00078 

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