Panda3D
movingPartScalar.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 movingPartScalar.h
10  * @author drose
11  * @date 1999-02-23
12  */
13 
14 #ifndef MOVINGPARTSCALAR_H
15 #define MOVINGPARTSCALAR_H
16 
17 #include "pandabase.h"
18 
19 #include "movingPart.h"
20 #include "animChannel.h"
21 #include "animChannelFixed.h"
22 
23 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, MovingPart<ACScalarSwitchType>);
24 
25 /**
26  * This is a particular kind of MovingPart that accepts a scalar each frame.
27  */
28 class EXPCL_PANDA_CHAN MovingPartScalar : public MovingPart<ACScalarSwitchType> {
29 protected:
30  INLINE MovingPartScalar(const MovingPartScalar &copy);
31 
32 public:
33  INLINE MovingPartScalar(PartGroup *parent, const std::string &name,
34  const PN_stdfloat &default_value = 0);
35  virtual ~MovingPartScalar();
36 
37  virtual void get_blend_value(const PartBundle *root);
38 
39  virtual bool apply_freeze_scalar(PN_stdfloat value);
40  virtual bool apply_control(PandaNode *node);
41 
42 protected:
43  INLINE MovingPartScalar();
44 
45 public:
46  static void register_with_read_factory();
47 
48  static TypedWritable *make_MovingPartScalar(const FactoryParams &params);
49 
50 public:
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 PUBLISHED:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59 public:
60  static void init_type() {
63  register_type(_type_handle, "MovingPartScalar",
65  }
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 #include "movingPartScalar.I"
72 
73 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
This template class is a special kind of AnimChannel that always returns just one fixed value.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 apply_control(PandaNode *node)
Specifies a node to influence this particular joint so that it will always hold the node's transform.
Definition: partGroup.cxx:225
static void register_with_read_factory()
Factory method to generate a PartGroup object.
Definition: partGroup.cxx:695
This is a particular kind of MovingPart that accepts a scalar each frame.
This is the root of a MovingPart hierarchy.
Definition: partBundle.h:46
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
virtual bool apply_freeze_scalar(PN_stdfloat value)
Freezes this particular joint so that it will always hold the specified transform.
Definition: partGroup.cxx:211
This is the base class for PartRoot and MovingPart.
Definition: partGroup.h:43