Panda3D
movingPartMatrix.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 movingPartMatrix.h
10  * @author drose
11  * @date 1999-02-23
12  */
13 
14 #ifndef MOVINGPARTMATRIX_H
15 #define MOVINGPARTMATRIX_H
16 
17 #include "pandabase.h"
18 
19 #include "movingPart.h"
20 #include "animChannel.h"
21 #include "animChannelFixed.h"
22 #include "cmath.h"
23 
24 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, MovingPart<ACMatrixSwitchType>);
25 
26 /**
27  * This is a particular kind of MovingPart that accepts a matrix each frame.
28  */
29 class EXPCL_PANDA_CHAN MovingPartMatrix : public MovingPart<ACMatrixSwitchType> {
30 protected:
31  INLINE MovingPartMatrix(const MovingPartMatrix &copy);
32 
33 public:
34  INLINE MovingPartMatrix(PartGroup *parent, const std::string &name,
35  const LMatrix4 &default_value);
36  virtual ~MovingPartMatrix();
37 
38  virtual AnimChannelBase *make_default_channel() const;
39  virtual void get_blend_value(const PartBundle *root);
40 
41  virtual bool apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
42  virtual bool apply_control(PandaNode *node);
43 
44 protected:
45  INLINE MovingPartMatrix();
46 
47 public:
48  static void register_with_read_factory();
49 
50  static TypedWritable *make_MovingPartMatrix(const FactoryParams &params);
51 
52 public:
53  virtual TypeHandle get_type() const {
54  return get_class_type();
55  }
56  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
57 PUBLISHED:
58  static TypeHandle get_class_type() {
59  return _type_handle;
60  }
61 public:
62  static void init_type() {
65  register_type(_type_handle, "MovingPartMatrix",
67  }
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "movingPartMatrix.I"
74 
75 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
virtual AnimChannelBase * make_default_channel() const
Creates and returns a new AnimChannel that is not part of any hierarchy, but that returns the default...
Definition: movingPart.I:81
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Parent class for all animation channels.
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.
virtual bool apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale)
Freezes this particular joint so that it will always hold the specified transform.
Definition: partGroup.cxx:198
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 matrix 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
This is the base class for PartRoot and MovingPart.
Definition: partGroup.h:43