Panda3D
characterSlider.h
1 // Filename: characterSlider.h
2 // Created by: drose (03Mar99)
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 CHARACTERSLIDER_H
16 #define CHARACTERSLIDER_H
17 
18 #include "pandabase.h"
19 
20 #include "movingPartScalar.h"
21 
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : CharacterSlider
26 // Description : This is a morph slider within the character. It's
27 // simply a single floating-point value that animates
28 // generally between 0 and 1, that controls the effects
29 // of one or more morphs within the character.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_CHAR CharacterSlider : public MovingPartScalar {
32 protected:
34  CharacterSlider(const CharacterSlider &copy);
35 
36 PUBLISHED:
37  CharacterSlider(PartGroup *parent, const string &name);
38  virtual ~CharacterSlider();
39 
40  virtual PartGroup *make_copy() const;
41 
42  virtual bool update_internals(PartBundle *root, PartGroup *parent,
43  bool self_changed, bool parent_changed,
44  Thread *current_thread);
45 
46 private:
48  VertexSliders _vertex_sliders;
49 
50 public:
51  static void register_with_read_factory();
52 
53  static TypedWritable *make_CharacterSlider(const FactoryParams &params);
54 
55 public:
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60 PUBLISHED:
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64 public:
65  static void init_type() {
66  MovingPartScalar::init_type();
67  register_type(_type_handle, "CharacterSlider",
68  MovingPartScalar::get_class_type());
69  }
70 
71 private:
72  static TypeHandle _type_handle;
73 
74  friend class CharacterVertexSlider;
75 };
76 
77 #endif
78 
79 
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
static void register_with_read_factory()
Factory method to generate a MovingPartScalar object.
This is a specialization on VertexSlider that returns the slider value associated with a particular C...
This is a morph slider within the character.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
virtual bool update_internals(PartBundle *root, PartGroup *parent, bool self_changed, bool parent_changed, Thread *current_thread)
This is called by do_update() whenever the part or some ancestor has changed values.
This is a particular kind of MovingPart that accepts a scalar each frame.
A thread; that is, a lightweight process.
Definition: thread.h:51
This is the root of a MovingPart hierarchy.
Definition: partBundle.h:49
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual PartGroup * make_copy() const
Allocates and returns a new copy of the node.
Definition: partGroup.cxx:76
This is the base class for PartRoot and MovingPart.
Definition: partGroup.h:45