Panda3D
 All Classes Functions Variables Enumerations
movingPartMatrix.h
1 // Filename: movingPartMatrix.h
2 // Created by: drose (23Feb99)
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 MOVINGPARTMATRIX_H
16 #define MOVINGPARTMATRIX_H
17 
18 #include "pandabase.h"
19 
20 #include "movingPart.h"
21 #include "animChannel.h"
22 #include "animChannelFixed.h"
23 #include "cmath.h"
24 
25 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, MovingPart<ACMatrixSwitchType>);
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : MovingPartMatrix
29 // Description : This is a particular kind of MovingPart that accepts
30 // a matrix each frame.
31 ////////////////////////////////////////////////////////////////////
32 class EXPCL_PANDA_CHAN MovingPartMatrix : public MovingPart<ACMatrixSwitchType> {
33 protected:
34  INLINE MovingPartMatrix(const MovingPartMatrix &copy);
35 
36 public:
37  INLINE MovingPartMatrix(PartGroup *parent, const string &name,
38  const LMatrix4 &default_value);
39  virtual ~MovingPartMatrix();
40 
41  virtual AnimChannelBase *make_default_channel() const;
42  virtual void get_blend_value(const PartBundle *root);
43 
44  virtual bool apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
45  virtual bool apply_control(PandaNode *node);
46 
47 protected:
48  INLINE MovingPartMatrix();
49 
50 public:
51  static void register_with_read_factory();
52 
53  static TypedWritable *make_MovingPartMatrix(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() {
68  register_type(_type_handle, "MovingPartMatrix",
70  }
71 
72 private:
73  static TypeHandle _type_handle;
74 };
75 
76 #include "movingPartMatrix.I"
77 
78 // Tell GCC that we'll take care of the instantiation explicitly here.
79 #ifdef __GNUC__
80 #pragma interface
81 #endif
82 
83 #endif
84 
85 
86 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
Parent class for all animation channels.
This template class is a special kind of AnimChannel that always returns just one fixed value...
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
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:229
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 apply_control(PandaNode *node)
Specifies a node to influence this particular joint so that it will always hold the node&#39;s transform...
Definition: partGroup.cxx:263
static void register_with_read_factory()
Factory method to generate a PartGroup object.
Definition: partGroup.cxx:790
This is a particular kind of MovingPart that accepts a matrix each frame.
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 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:95
This is the base class for PartRoot and MovingPart.
Definition: partGroup.h:45