Panda3D
characterSlider.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file characterSlider.h
10  * @author drose
11  * @date 1999-03-03
12  */
13 
14 #ifndef CHARACTERSLIDER_H
15 #define CHARACTERSLIDER_H
16 
17 #include "pandabase.h"
18 
19 #include "movingPartScalar.h"
20 
22 
23 /**
24  * This is a morph slider within the character. It's simply a single
25  * floating-point value that animates generally between 0 and 1, that controls
26  * the effects of one or more morphs within the character.
27  */
28 class EXPCL_PANDA_CHAR CharacterSlider : public MovingPartScalar {
29 protected:
31  CharacterSlider(const CharacterSlider &copy);
32 
33 PUBLISHED:
34  explicit CharacterSlider(PartGroup *parent, const std::string &name);
35  virtual ~CharacterSlider();
36 
37 public:
38  virtual PartGroup *make_copy() const;
39 
40  virtual bool update_internals(PartBundle *root, PartGroup *parent,
41  bool self_changed, bool parent_changed,
42  Thread *current_thread);
43 
44 private:
46  VertexSliders _vertex_sliders;
47 
48 public:
49  static void register_with_read_factory();
50 
51  static TypedWritable *make_CharacterSlider(const FactoryParams &params);
52 
53 public:
54  virtual TypeHandle get_type() const {
55  return get_class_type();
56  }
57  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
58 PUBLISHED:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62 public:
63  static void init_type() {
64  MovingPartScalar::init_type();
65  register_type(_type_handle, "CharacterSlider",
66  MovingPartScalar::get_class_type());
67  }
68 
69 private:
70  static TypeHandle _type_handle;
71 
72  friend class CharacterVertexSlider;
73 };
74 
75 #endif
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
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:46
This is the root of a MovingPart hierarchy.
Definition: partBundle.h:46
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
virtual PartGroup * make_copy() const
Allocates and returns a new copy of the node.
Definition: partGroup.cxx:67
This is the base class for PartRoot and MovingPart.
Definition: partGroup.h:43