Panda3D
eggJointPointer.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 eggJointPointer.h
10  * @author drose
11  * @date 2001-02-26
12  */
13 
14 #ifndef EGGJOINTPOINTER_H
15 #define EGGJOINTPOINTER_H
16 
17 #include "pandatoolbase.h"
18 #include "eggBackPointer.h"
19 #include "eggGroup.h"
20 #include "luse.h"
21 
22 class EggCharacterDb;
23 
24 /**
25  * This is a base class for EggJointNodePointer and EggMatrixTablePointer. It
26  * stores a back pointer to either a <Joint> entry or an xform <Table> data,
27  * and thus presents an interface that returns 1-n matrices, one for each
28  * frame. (<Joint> entries, for model files, appear the same as one-frame
29  * animations.)
30  */
32 public:
33  virtual int get_num_frames() const=0;
34  virtual LMatrix4d get_frame(int n) const=0;
35  virtual void set_frame(int n, const LMatrix4d &mat)=0;
36  virtual bool add_frame(const LMatrix4d &mat);
37 
38  virtual void do_finish_reparent(EggJointPointer *new_parent)=0;
39  virtual void move_vertices_to(EggJointPointer *new_joint);
40 
41  virtual bool do_rebuild(EggCharacterDb &db);
42 
43  virtual void optimize();
44  virtual void expose(EggGroup::DCSType dcs_type);
45  virtual void zero_channels(const std::string &components);
46  virtual void quantize_channels(const std::string &components, double quantum);
47  virtual void apply_default_pose(EggJointPointer *source_joint, int frame);
48 
49  virtual EggJointPointer *make_new_joint(const std::string &name)=0;
50 
51 public:
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  EggBackPointer::init_type();
57  register_type(_type_handle, "EggJointPointer",
58  EggBackPointer::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 #include "eggJointPointer.I"
70 
71 #endif
virtual void optimize()
Resets the table before writing to disk so that redundant rows (e.g.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool add_frame(const LMatrix4d &mat)
Appends a new frame onto the end of the data, if possible; returns true if not possible,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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
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).
This class is used during joint optimization or restructuring to store the table of interim joint com...
virtual void quantize_channels(const std::string &components, double quantum)
Rounds the named components of the transform to the nearest multiple of quantum.
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 ...
This is a base class for EggJointNodePointer and EggMatrixTablePointer.
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 zero_channels(const std::string &components)
Zeroes out the named components of the transform in the animation frames.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This stores a pointer from an EggJointData or EggSliderData object back to the referencing data in an...