Panda3D
eggCharacterDb.h
1 // Filename: eggCharacterDb.h
2 // Created by: drose (05Oct06)
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 EGGCHARACTERDB_H
16 #define EGGCHARACTERDB_H
17 
18 #include "pandatoolbase.h"
19 #include "pmap.h"
20 
21 /*
22 #ifdef HAVE_BDB
23 
24 // Apparently, we have to define this to make db_cxx files include the
25 // modern header files.
26 #define HAVE_CXX_STDHEADERS 1
27 #include <db_cxx.h>
28 
29 #endif // HAVE_BDB
30 */
31 
32 class EggJointPointer;
33 
34 ////////////////////////////////////////////////////////////////////
35 // Class : EggCharacterDb
36 // Description : This class is used during joint optimization or
37 // restructuring to store the table of interim joint
38 // computations.
39 //
40 // That is to say, this class provides an temporary data
41 // store for three tables of matrices per each
42 // EggJointPointer per frame.
43 ////////////////////////////////////////////////////////////////////
45 public:
47  ~EggCharacterDb();
48 
49  enum TableType {
50  TT_rebuild_frame,
51  TT_net_frame,
52  TT_net_frame_inv,
53  };
54 
55  bool get_matrix(const EggJointPointer *joint, TableType type,
56  int frame, LMatrix4d &mat) const;
57  void set_matrix(const EggJointPointer *joint, TableType type,
58  int frame, const LMatrix4d &mat);
59 
60 private:
61  class Key {
62  public:
63  INLINE Key(const EggJointPointer *joint,
64  TableType table_type,
65  int frame);
66  INLINE bool operator < (const Key &other) const;
67 
68  private:
69  const EggJointPointer *_joint;
70  TableType _table_type;
71  int _frame;
72  };
73 
74  /*
75 #ifdef HAVE_BDB
76  Db *_db;
77  Filename _db_filename;
78 #endif // HAVE_BDB
79  */
80 
82  Table _table;
83 };
84 
85 #include "eggCharacterDb.I"
86 
87 #endif
88 
89 
EggCharacterDb()
Constructs a database for storing the interim work for the indicated EggCharacterData.
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
This class is used during joint optimization or restructuring to store the table of interim joint com...
void set_matrix(const EggJointPointer *joint, TableType type, int frame, const LMatrix4d &mat)
Stores the matrix for the indicated joint, type, and frame in the database.
This is a base class for EggJointNodePointer and EggMatrixTablePointer.
bool get_matrix(const EggJointPointer *joint, TableType type, int frame, LMatrix4d &mat) const
Looks up the data for the indicated joint, type, and frame, and fills it in result (and returns true)...