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() {
63 MovingPart<ACMatrixSwitchType>::init_type();
64 AnimChannelFixed<ACMatrixSwitchType>::init_type();
65 register_type(_type_handle, "MovingPartMatrix",
66 MovingPart<ACMatrixSwitchType>::get_class_type());
67 }
68
69 private:
70 static TypeHandle _type_handle;
71 };
72
73 #include "movingPartMatrix.I"
74
75 #endif
animChannelFixed.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
animChannel.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AnimChannelBase
Parent class for all animation channels.
Definition: animChannelBase.h:30
AnimChannelFixed
This template class is a special kind of AnimChannel that always returns just one fixed value.
Definition: animChannelFixed.h:29
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
MovingPartMatrix
This is a particular kind of MovingPart that accepts a matrix each frame.
Definition: movingPartMatrix.h:29
MovingPart< ACMatrixSwitchType >
MovingPart::make_default_channel
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
PandaNode
A basic node of the scene graph or data graph.
Definition: pandaNode.h:65
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::apply_control
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
PartGroup::register_with_read_factory
static void register_with_read_factory()
Factory method to generate a PartGroup object.
Definition: partGroup.cxx:695
PartGroup::apply_freeze_matrix
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
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
cmath.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
movingPartMatrix.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
movingPart.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