Panda3D

eggJointNodePointer.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 eggJointNodePointer.h
10 * @author drose
11 * @date 2001-02-26
12 */
13
14 #ifndef EGGJOINTNODEPOINTER_H
15 #define EGGJOINTNODEPOINTER_H
16
17 #include "pandatoolbase.h"
18
19 #include "eggJointPointer.h"
20
21 #include "eggGroup.h"
22 #include "pointerTo.h"
23
24 /**
25 * This stores a pointer back to a <Joint> node.
26 */
27 class EggJointNodePointer : public EggJointPointer {
28 public:
29 EggJointNodePointer(EggObject *object);
30
31 virtual int get_num_frames() const;
32 virtual LMatrix4d get_frame(int n) const;
33 virtual void set_frame(int n, const LMatrix4d &mat);
34
35 virtual void do_finish_reparent(EggJointPointer *new_parent);
36 virtual void move_vertices_to(EggJointPointer *new_joint);
37
38 virtual bool do_rebuild(EggCharacterDb &db);
39 virtual void expose(EggGroup::DCSType dcs_type);
40 virtual void apply_default_pose(EggJointPointer *source_joint, int frame);
41
42 virtual bool has_vertices() const;
43
44 virtual EggJointPointer *make_new_joint(const std::string &name);
45
46 virtual void set_name(const std::string &name);
47
48 private:
49 PT(EggGroup) _joint;
50
51 public:
52 static TypeHandle get_class_type() {
53 return _type_handle;
54 }
55 static void init_type() {
56 EggJointPointer::init_type();
57 register_type(_type_handle, "EggJointNodePointer",
58 EggJointPointer::get_class_type());
59 }
60 virtual TypeHandle get_type() const {
61 return get_class_type();
62 }
63 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64
65 private:
66 static TypeHandle _type_handle;
67 };
68
69 #endif
EggCharacterDb
This class is used during joint optimization or restructuring to store the table of interim joint com...
Definition: eggCharacterDb.h:41
EggGroup
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:34
EggJointNodePointer
This stores a pointer back to a <Joint> node.
Definition: eggJointNodePointer.h:27
EggJointNodePointer::set_frame
virtual void set_frame(int n, const LMatrix4d &mat)
Sets the transform matrix corresponding to this joint position in the nth frame.
Definition: eggJointNodePointer.cxx:76
EggJointNodePointer::expose
virtual void expose(EggGroup::DCSType dcs_type)
Flags the joint with the indicated DCS flag so that it will be loaded as a separate node in the playe...
Definition: eggJointNodePointer.cxx:153
EggJointNodePointer::do_finish_reparent
virtual void do_finish_reparent(EggJointPointer *new_parent)
Performs the actual reparenting operation by removing the node from its old parent and associating it...
Definition: eggJointNodePointer.cxx:86
EggJointNodePointer::make_new_joint
virtual EggJointPointer * make_new_joint(const std::string &name)
Creates a new child of the current joint in the egg data, and returns a pointer to it.
Definition: eggJointNodePointer.cxx:196
EggJointNodePointer::apply_default_pose
virtual void apply_default_pose(EggJointPointer *source_joint, int frame)
Applies the pose from the indicated frame of the indicated source joint as the initial pose for this ...
Definition: eggJointNodePointer.cxx:164
EggJointNodePointer::has_vertices
virtual bool has_vertices() const
Returns true if there are any vertices referenced by the node this points to, false otherwise.
Definition: eggJointNodePointer.cxx:183
EggJointNodePointer::get_frame
virtual LMatrix4d get_frame(int n) const
Returns the transform matrix corresponding to this joint position in the nth frame.
Definition: eggJointNodePointer.cxx:62
EggJointNodePointer::move_vertices_to
virtual void move_vertices_to(EggJointPointer *new_joint)
Moves the vertices assigned to this joint into the other joint (which should be of the same type).
Definition: eggJointNodePointer.cxx:110
EggJointNodePointer::get_num_frames
virtual int get_num_frames() const
Returns the number of frames of animation for this particular joint.
Definition: eggJointNodePointer.cxx:49
EggJointNodePointer::set_name
virtual void set_name(const std::string &name)
Applies the indicated name change to the egg file.
Definition: eggJointNodePointer.cxx:207
EggJointNodePointer::do_rebuild
virtual bool do_rebuild(EggCharacterDb &db)
Rebuilds the entire table all at once, based on the frames added by repeated calls to add_rebuild_fra...
Definition: eggJointNodePointer.cxx:133
EggJointPointer
This is a base class for EggJointNodePointer and EggMatrixTablePointer.
Definition: eggJointPointer.h:31
EggObject
The highest-level base class in the egg directory.
Definition: eggObject.h:29
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
eggGroup.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
eggJointPointer.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.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