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

direct/src/interval/cLerpAnimEffectInterval.h

Go to the documentation of this file.
00001 // Filename: cLerpAnimEffectInterval.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 CLERPANIMEFFECTINTERVAL_H
00020 #define CLERPANIMEFFECTINTERVAL_H
00021 
00022 #include "directbase.h"
00023 #include "cLerpInterval.h"
00024 #include "animControl.h"
00025 #include "pointerTo.h"
00026 #include "pvector.h"
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : CLerpAnimEffectInterval
00030 // Description : This interval lerps between different amounts of
00031 //               control effects for various AnimControls that might
00032 //               be playing on an actor.  It's used to change the
00033 //               blending amount between multiple animations.
00034 //
00035 //               The idea is to start all the animations playing
00036 //               first, then use a CLerpAnimEffectInterval to adjust
00037 //               the degree to which each animation affects the actor.
00038 ////////////////////////////////////////////////////////////////////
00039 class EXPCL_DIRECT CLerpAnimEffectInterval : public CLerpInterval {
00040 PUBLISHED:
00041   INLINE CLerpAnimEffectInterval(const string &name, double duration, 
00042                                  BlendType blend_type);
00043 
00044   INLINE void add_control(AnimControl *control, const string &name,
00045                           float begin_effect, float end_effect);
00046 
00047   virtual void priv_step(double t);
00048 
00049   virtual void output(ostream &out) const;
00050 
00051 private:
00052   class ControlDef {
00053   public:
00054     INLINE ControlDef(AnimControl *control, const string &name,
00055                       float begin_effect, float end_effect);
00056     PT(AnimControl) _control;
00057     string _name;
00058     float _begin_effect;
00059     float _end_effect;
00060   };
00061     
00062   typedef pvector<ControlDef> Controls;
00063   Controls _controls;
00064   
00065 
00066 public:
00067   static TypeHandle get_class_type() {
00068     return _type_handle;
00069   }
00070   static void init_type() {
00071     CLerpInterval::init_type();
00072     register_type(_type_handle, "CLerpAnimEffectInterval",
00073                   CLerpInterval::get_class_type());
00074   }
00075   virtual TypeHandle get_type() const {
00076     return get_class_type();
00077   }
00078   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00079 
00080 private:
00081   static TypeHandle _type_handle;
00082 };
00083 
00084 #include "cLerpAnimEffectInterval.I"
00085 
00086 #endif
00087 

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