Panda3D
 All Classes Functions Variables Enumerations
eggMatrixTablePointer.h
1 // Filename: eggMatrixTablePointer.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 EGGMATRIXTABLEPOINTER_H
16 #define EGGMATRIXTABLEPOINTER_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggJointPointer.h"
21 
22 #include "eggTable.h"
23 #include "eggXfmSAnim.h"
24 #include "pointerTo.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : EggMatrixTablePointer
28 // Description : This stores a pointer back to an EggXfmSAnim table
29 // (i.e. an <Xfm$Anim_S$> entry in an egg file),
30 // corresponding to the animation data from a single
31 // bundle for this joint.
32 ////////////////////////////////////////////////////////////////////
34 public:
36 
37  virtual double get_frame_rate() const;
38  virtual int get_num_frames() const;
39  virtual void extend_to(int num_frames);
40  virtual LMatrix4d get_frame(int n) const;
41  virtual void set_frame(int n, const LMatrix4d &mat);
42  virtual bool add_frame(const LMatrix4d &mat);
43 
44  virtual void do_finish_reparent(EggJointPointer *new_parent);
45 
46  virtual bool do_rebuild(EggCharacterDb &db);
47 
48  virtual void optimize();
49  virtual void zero_channels(const string &components);
50  virtual void quantize_channels(const string &components, double quantum);
51 
52  virtual EggJointPointer *make_new_joint(const string &name);
53 
54  virtual void set_name(const string &name);
55 
56 private:
57  PT(EggTable) _table;
58  PT(EggXfmSAnim) _xform;
59 
60 public:
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64  static void init_type() {
65  EggJointPointer::init_type();
66  register_type(_type_handle, "EggMatrixTablePointer",
67  EggJointPointer::get_class_type());
68  }
69  virtual TypeHandle get_type() const {
70  return get_class_type();
71  }
72  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
73 
74 private:
75  static TypeHandle _type_handle;
76 };
77 
78 #endif
79 
80 
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
virtual void set_frame(int n, const LMatrix4d &mat)
Sets the transform matrix corresponding to this joint position in the nth frame.
virtual void extend_to(int num_frames)
Extends the table to the indicated number of frames.
virtual void set_name(const string &name)
Applies the indicated name change to the egg file.
virtual void optimize()
Resets the table before writing to disk so that redundant rows (e.g.
virtual int get_num_frames() const
Returns the number of frames of animation for this particular joint.
virtual double get_frame_rate() const
Returns the stated frame rate of this particular joint, or 0.0 if it doesn&#39;t state.
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...
This class is used during joint optimization or restructuring to store the table of interim joint com...
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 bool add_frame(const LMatrix4d &mat)
Appends a new frame onto the end of the data, if possible; returns true if not possible, or false otherwise (e.g.
This corresponds to an &lt;Xfm$Anim_S$&gt; entry, which is a collection of up to nine &lt;S$Anim&gt; entries that...
Definition: eggXfmSAnim.h:33
This is a base class for EggJointNodePointer and EggMatrixTablePointer.
This corresponds to a.
Definition: eggTable.h:31
This stores a pointer back to an EggXfmSAnim table (i.e.
virtual void quantize_channels(const string &components, double quantum)
Rounds the named components of the transform to the nearest multiple of quantum.
virtual LMatrix4d get_frame(int n) const
Returns the transform matrix corresponding to this joint position in the nth frame.
virtual void do_finish_reparent(EggJointPointer *new_parent)
Performs the actual reparenting operation by removing the node from its old parent and associating it...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual void zero_channels(const string &components)
Zeroes out the named components of the transform in the animation frames.
The highest-level base class in the egg directory.
Definition: eggObject.h:31