Panda3D

Loading...
Searching...
No Matches
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
21 class CharacterVertexSlider;
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:
30 CharacterSlider();
31 CharacterSlider(const CharacterSlider &copy);
32
33PUBLISHED:
34 explicit CharacterSlider(PartGroup *parent, const std::string &name);
35 explicit CharacterSlider(PartGroup *parent, const std::string &name, const PN_stdfloat &default_value);
36 virtual ~CharacterSlider();
37
38 public:
39 virtual PartGroup *make_copy() const;
40
41 virtual bool update_internals(PartBundle *root, PartGroup *parent,
42 bool self_changed, bool parent_changed,
43 Thread *current_thread);
44
45 private:
46 typedef pset<CharacterVertexSlider *> VertexSliders;
47 VertexSliders _vertex_sliders;
48
49 public:
50 static void register_with_read_factory();
51
52 static TypedWritable *make_CharacterSlider(const FactoryParams &params);
53
54 public:
55 virtual TypeHandle get_type() const {
56 return get_class_type();
57 }
58 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
59PUBLISHED:
60 static TypeHandle get_class_type() {
61 return _type_handle;
62 }
63 public:
64 static void init_type() {
65 MovingPartScalar::init_type();
66 register_type(_type_handle, "CharacterSlider",
67 MovingPartScalar::get_class_type());
68 }
69
70 private:
71 static TypeHandle _type_handle;
72
73 friend class CharacterVertexSlider;
74};
75
76#endif
CharacterSlider::make_CharacterSlider
static TypedWritable * make_CharacterSlider(const FactoryParams &params)
Factory method to generate a CharacterSlider object.
Definition characterSlider.cxx:96
CharacterVertexSlider
This is a specialization on VertexSlider that returns the slider value associated with a particular C...
Definition characterVertexSlider.h:26
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition factoryParams.h:36
MovingPartBase::update_internals
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.
Definition movingPartBase.cxx:180
MovingPartScalar::register_with_read_factory
static void register_with_read_factory()
Factory method to generate a MovingPartScalar object.
Definition movingPartScalar.cxx:151
PartBundle
This is the root of a MovingPart hierarchy.
Definition partBundle.h:46
PartGroup
This is the base class for PartRoot and MovingPart.
Definition partGroup.h:43
PartGroup::make_copy
virtual PartGroup * make_copy() const
Allocates and returns a new copy of the node.
Definition partGroup.cxx:67
Thread
A thread; that is, a lightweight process.
Definition thread.h:46
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
TypedWritable
Base class for objects that can be written to and read from Bam files.
Definition typedWritable.h:35
movingPartScalar.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
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