1 | #ifndef _BBCCOLLADAMESHSERIALIZER_H |
---|
2 | #define _BBCCOLLADAMESHSERIALIZER_H |
---|
3 | |
---|
4 | #include <BBC.h> |
---|
5 | #include <OgreNoMemoryMacros.h> |
---|
6 | #include <FUtils.h> |
---|
7 | #include <FUXmlWriter.h> |
---|
8 | #include <FUDaeEnum.h> |
---|
9 | #include <FCDocument.h> |
---|
10 | #include <FCDLibrary.h> |
---|
11 | #include <FCDMaterialLibrary.h> |
---|
12 | #include <FCDSceneNode.h> |
---|
13 | #include <FCDGeometry.h> |
---|
14 | #include <FCDGeometryMesh.h> |
---|
15 | #include <FCDGeometrySource.h> |
---|
16 | #include <FCDGeometryPolygons.h> |
---|
17 | #include <FCDGeometryInstance.h> |
---|
18 | #include <FCDMaterialInstance.h> |
---|
19 | #include <FCDMaterial.h> |
---|
20 | #include <FCDEffect.h> |
---|
21 | |
---|
22 | |
---|
23 | namespace BBC { |
---|
24 | |
---|
25 | class _BBCExport ColladaMeshSerializer |
---|
26 | { |
---|
27 | public: |
---|
28 | ColladaMeshSerializer(); |
---|
29 | |
---|
30 | virtual ~ColladaMeshSerializer(); |
---|
31 | |
---|
32 | void setEntity(EntityPtr entity); |
---|
33 | |
---|
34 | EntityPtr getEntity(); |
---|
35 | |
---|
36 | void exportMesh(const Ogre::String& fileName, bool mergeSubMeshes, bool tangents); |
---|
37 | |
---|
38 | void save(Ogre::String filename); |
---|
39 | |
---|
40 | protected: |
---|
41 | |
---|
42 | EntityPtr mEntity; |
---|
43 | |
---|
44 | FCDocument* mFCDocument; |
---|
45 | |
---|
46 | FCDGeometry* mFCDGeometry; |
---|
47 | |
---|
48 | FCDGeometryMesh* mFCDGeometryMesh; |
---|
49 | |
---|
50 | FCDGeometrySource* mFCDGeometryColorSource; |
---|
51 | |
---|
52 | FCDGeometrySource* mFCDGeometryTexCoordSource; |
---|
53 | |
---|
54 | FCDGeometrySource* mFCDGeometryVertexSource; |
---|
55 | |
---|
56 | FCDGeometrySource* mFCDGeometryNormalsSource; |
---|
57 | |
---|
58 | FCDGeometryPolygons* mFCDGeometryPolygons; |
---|
59 | |
---|
60 | FCDGeometryPolygonsInput* mFCDGeometryPolygonsInput; |
---|
61 | |
---|
62 | FCDVisualSceneNodeLibrary* mFCDVisualSceneNodeLibrary; |
---|
63 | |
---|
64 | FCDSceneNode* mSceneNode; |
---|
65 | |
---|
66 | FCDGeometryInstance* mFCDGeometryInstance; |
---|
67 | |
---|
68 | FCDEntityInstanceList mFCDEntityInstanceList; |
---|
69 | |
---|
70 | FCDMaterialInstance* mFCDMaterialInstance; |
---|
71 | |
---|
72 | FCDMaterialInstanceList mFCDMaterialInstanceList; |
---|
73 | |
---|
74 | FCDMaterial* mFCDMaterial; |
---|
75 | |
---|
76 | FCDEffect* mFCDEffect; |
---|
77 | |
---|
78 | FloatList mFloatPositionList; |
---|
79 | |
---|
80 | FloatList mFloatNormalList; |
---|
81 | |
---|
82 | UInt32List mIntPositionIDFaceList; |
---|
83 | |
---|
84 | FloatList mFloatColorList; |
---|
85 | |
---|
86 | FloatList mFloatTexCoordList[OGRE_MAX_TEXTURE_COORD_SETS]; |
---|
87 | |
---|
88 | unsigned int iCount; |
---|
89 | |
---|
90 | unsigned int iSubEntityFirstIDFace; |
---|
91 | |
---|
92 | unsigned int iSubEntityNextFirstIDFace; |
---|
93 | |
---|
94 | unsigned int iSubEntityLastIDFace; |
---|
95 | |
---|
96 | void buildMesh(MeshPtr pMesh, bool mergeSubmeshes); |
---|
97 | |
---|
98 | void exportSubMeshes(MeshPtr pMesh); |
---|
99 | |
---|
100 | void exportSubMesh(MeshPtr pMesh, unsigned int iSubMesh); |
---|
101 | }; |
---|
102 | |
---|
103 | |
---|
104 | } |
---|
105 | #endif |
---|