Panda3D
 All Classes Functions Variables Enumerations
cLerpInterval.h
1 // Filename: cLerpInterval.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 CLERPINTERVAL_H
16 #define CLERPINTERVAL_H
17 
18 #include "directbase.h"
19 #include "cInterval.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : CLerpInterval
23 // Description : The base class for a family of intervals that
24 // linearly interpolate one or more numeric values over
25 // time.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_DIRECT CLerpInterval : public CInterval {
28 PUBLISHED:
29  enum BlendType {
30  BT_no_blend,
31  BT_ease_in,
32  BT_ease_out,
33  BT_ease_in_out,
34  BT_invalid
35  };
36 
37 public:
38  INLINE CLerpInterval(const string &name, double duration,
39  BlendType blend_type);
40 
41 PUBLISHED:
42  INLINE BlendType get_blend_type() const;
43 
44  static BlendType string_blend_type(const string &blend_type);
45 
46 protected:
47  double compute_delta(double t) const;
48 
49 private:
50  BlendType _blend_type;
51 
52 
53 public:
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  CInterval::init_type();
59  register_type(_type_handle, "CLerpInterval",
60  CInterval::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 #include "cLerpInterval.I"
72 
73 #endif
74 
The base class for timeline components.
Definition: cInterval.h:39
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