Panda3D
 All Classes Functions Variables Enumerations
cLerpAnimEffectInterval.h
1 // Filename: cLerpAnimEffectInterval.h
2 // Created by: drose (27Aug02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CLERPANIMEFFECTINTERVAL_H
16 #define CLERPANIMEFFECTINTERVAL_H
17 
18 #include "directbase.h"
19 #include "cLerpInterval.h"
20 #include "animControl.h"
21 #include "pointerTo.h"
22 #include "pvector.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : CLerpAnimEffectInterval
26 // Description : This interval lerps between different amounts of
27 // control effects for various AnimControls that might
28 // be playing on an actor. It's used to change the
29 // blending amount between multiple animations.
30 //
31 // The idea is to start all the animations playing
32 // first, then use a CLerpAnimEffectInterval to adjust
33 // the degree to which each animation affects the actor.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_DIRECT CLerpAnimEffectInterval : public CLerpInterval {
36 PUBLISHED:
37  INLINE CLerpAnimEffectInterval(const string &name, double duration,
38  BlendType blend_type);
39 
40  INLINE void add_control(AnimControl *control, const string &name,
41  float begin_effect, float end_effect);
42 
43  virtual void priv_step(double t);
44 
45  virtual void output(ostream &out) const;
46 
47 private:
48  class ControlDef {
49  public:
50  INLINE ControlDef(AnimControl *control, const string &name,
51  float begin_effect, float end_effect);
52  PT(AnimControl) _control;
53  string _name;
54  float _begin_effect;
55  float _end_effect;
56  };
57 
59  Controls _controls;
60 
61 
62 public:
63  static TypeHandle get_class_type() {
64  return _type_handle;
65  }
66  static void init_type() {
67  CLerpInterval::init_type();
68  register_type(_type_handle, "CLerpAnimEffectInterval",
69  CLerpInterval::get_class_type());
70  }
71  virtual TypeHandle get_type() const {
72  return get_class_type();
73  }
74  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
75 
76 private:
77  static TypeHandle _type_handle;
78 };
79 
80 #include "cLerpAnimEffectInterval.I"
81 
82 #endif
83 
virtual void priv_step(double t)
Advances the time on the interval.
Definition: cInterval.cxx:407
This interval lerps between different amounts of control effects for various AnimControls that might ...
Controls the timing of a character animation.
Definition: animControl.h:41
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
The base class for a family of intervals that linearly interpolate one or more numeric values over ti...
Definition: cLerpInterval.h:27