Panda3D
daeToEggConverter.h
1 // Filename: daeToEggConverter.h
2 // Created by: pro-rsoft (08May08)
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 DAETOEGGCONVERTER_H
16 #define DAETOEGGCONVERTER_H
17 
18 #include "pandatoolbase.h"
19 #include "somethingToEggConverter.h"
20 #include "eggGroup.h"
21 #include "eggMaterial.h"
22 #include "eggTexture.h"
23 #include "eggTable.h"
24 #include "eggNurbsCurve.h"
25 
26 #include "pre_fcollada_include.h"
27 #include "FCollada.h"
28 #include "FCDocument/FCDocument.h"
29 #include "FCDocument/FCDTransform.h"
30 #include "FCDocument/FCDEntityInstance.h"
31 #include "FCDocument/FCDControllerInstance.h"
32 #include "FCDocument/FCDGeometryMesh.h"
33 #include "FCDocument/FCDGeometrySpline.h"
34 #include "FCDocument/FCDMaterial.h"
35 #include "FMath/FMMatrix44.h"
36 
37 #include "daeMaterials.h"
38 #include "daeCharacter.h"
39 #include "pvector.h" // Include last
40 
41 ////////////////////////////////////////////////////////////////////
42 // Class : DAEToEggConverter
43 // Description : This class supervises the construction of an
44 // EggData structure from a DAE file.
45 ////////////////////////////////////////////////////////////////////
47 public:
51 
53 
54  virtual string get_name() const;
55  virtual string get_extension() const;
56 
57  virtual bool convert_file(const Filename &filename);
58  virtual DistanceUnit get_input_units();
59 
60  bool _invert_transparency;
61 
62 private:
63  string _unit_name;
64  double _unit_meters;
65  PT(EggTable) _table;
66  FCDocument* _document;
67  FUErrorSimpleHandler* _error_handler;
68  DaeCharacter::JointMap _joints;
69 
71  Characters _characters;
72 
73  void process_asset();
74  void process_node(EggGroupNode *parent, const FCDSceneNode* node, bool forced = false);
75  void process_instance(EggGroup *parent, const FCDEntityInstance* instance);
76  void process_mesh(EggGroup *parent, const FCDGeometryMesh* mesh,
77  DaeMaterials *materials, DaeCharacter *character = NULL);
78  void process_spline(EggGroup *parent, const string group_name, FCDGeometrySpline* geometry_spline);
79  void process_spline(EggGroup *parent, const FCDSpline* spline);
80  void process_controller(EggGroup *parent, const FCDControllerInstance* instance);
81  void process_extra(EggGroup *group, const FCDExtra* extra);
82 
83  static LMatrix4d convert_matrix(const FMMatrix44& matrix);
84  void apply_transform(EggGroup *to, const FCDTransform* from);
85 
86  friend class DaeCharacter;
87 };
88 
89 #endif
virtual string get_name() const
Returns the English name of the file type this converter supports.
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:51
virtual bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
Class representing an animated character.
Definition: daeCharacter.h:37
This class is seperated from the converter file because otherwise it would get too big and needlessly...
Definition: daeMaterials.h:41
This class supervises the construction of an EggData structure from a DAE file.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:36
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
virtual DistanceUnit get_input_units()
This may be called after convert_file() has been called and returned true, indicating a successful co...
This corresponds to a.
Definition: eggTable.h:31
virtual string get_extension() const
Returns the common extension of the file type this converter supports.
This is a base class for a family of converter classes that manage a conversion from some file type t...