Panda3D
 All Classes Functions Variables Enumerations
eggJointNodePointer.h
1 // Filename: eggJointNodePointer.h
2 // Created by: drose (26Feb01)
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 EGGJOINTNODEPOINTER_H
16 #define EGGJOINTNODEPOINTER_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggJointPointer.h"
21 
22 #include "eggGroup.h"
23 #include "pointerTo.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : EggJointNodePointer
27 // Description : This stores a pointer back to a <Joint> node.
28 ////////////////////////////////////////////////////////////////////
30 public:
32 
33  virtual int get_num_frames() const;
34  virtual LMatrix4d get_frame(int n) const;
35  virtual void set_frame(int n, const LMatrix4d &mat);
36 
37  virtual void do_finish_reparent(EggJointPointer *new_parent);
38  virtual void move_vertices_to(EggJointPointer *new_joint);
39 
40  virtual bool do_rebuild(EggCharacterDb &db);
41  virtual void expose(EggGroup::DCSType dcs_type);
42  virtual void apply_default_pose(EggJointPointer *source_joint, int frame);
43 
44  virtual bool has_vertices() const;
45 
46  virtual EggJointPointer *make_new_joint(const string &name);
47 
48  virtual void set_name(const string &name);
49 
50 private:
51  PT(EggGroup) _joint;
52 
53 public:
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  EggJointPointer::init_type();
59  register_type(_type_handle, "EggJointNodePointer",
60  EggJointPointer::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 #endif
72 
73 
virtual LMatrix4d get_frame(int n) const
Returns the transform matrix corresponding to this joint position in the nth frame.
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
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 ...
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)...
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...
virtual void do_finish_reparent(EggJointPointer *new_parent)
Performs the actual reparenting operation by removing the node from its old parent and associating it...
The main glue of the egg hierarchy, this corresponds to the &lt;Group&gt;, &lt;Instance&gt;, and &lt;Joint&gt; type nod...
Definition: eggGroup.h:36
This stores a pointer back to a &lt;Joint&gt; node.
This class is used during joint optimization or restructuring to store the table of interim joint com...
virtual bool has_vertices() const
Returns true if there are any vertices referenced by the node this points to, false otherwise...
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...
This is a base class for EggJointNodePointer and EggMatrixTablePointer.
virtual void set_name(const string &name)
Applies the indicated name change to the egg file.
virtual int get_num_frames() const
Returns the number of frames of animation for this particular joint.
virtual EggJointPointer * make_new_joint(const string &name)
Creates a new child of the current joint in the egg data, and returns a pointer to it...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
The highest-level base class in the egg directory.
Definition: eggObject.h:31
virtual void set_frame(int n, const LMatrix4d &mat)
Sets the transform matrix corresponding to this joint position in the nth frame.