Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_MESHSAVER_SPM_H__
00009 #define __SP_MESHSAVER_SPM_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013
00014 #ifdef SP_COMPILE_WITH_MESHSAVER_SPM
00015
00016
00017 #include "FileFormats/Mesh/spMeshLoaderSPM.hpp"
00018 #include "FileFormats/Mesh/spMeshSaver.hpp"
00019
00020
00021 namespace sp
00022 {
00023 namespace scene
00024 {
00025
00026
00027 class SP_EXPORT MeshSaverSPM : public MeshSaver
00028 {
00029
00030 public:
00031
00032 MeshSaverSPM();
00033 ~MeshSaverSPM();
00034
00035 bool saveMesh(Mesh* Model, const io::stringc &Filename);
00036
00037
00038
00039 static void setTextureIntern(bool isWriteIntern);
00040 static bool getTextureIntern();
00041
00042 private:
00043
00044
00045
00046 void writeHeader();
00047
00048 void writeChunkObject();
00049 void writeChunkSubMesh(Mesh* SubMesh);
00050 void writeChunkSurface(const u32 Surface);
00051 void writeChunkVertex(const u32 Vertex);
00052 void writeChunkTriangle(const u32 Triangle);
00053 void writeChunkTexture(const u8 Layer);
00054
00055 void writeChunkAnimationNode();
00056 void writeChunkAnimationMorphTarget();
00057 void writeChunkAnimationSkeletal();
00058 void writeChunkAnimationJoint(const scene::AnimationJoint* Joint);
00059
00060 bool areIndex32BitNeeded() const;
00061 bool areVertexColorsEqual() const;
00062 bool areVertexFogCoordsEqual() const;
00063
00064 void checkTexCoordsDimensions();
00065
00066
00067
00068 Mesh* CurMesh_;
00069
00070 bool areIndices32Bit_;
00071 bool areVertexColorsEqual_;
00072 bool areVertexFogCoordsEqual_;
00073 bool isGouraudShading_;
00074
00075 u8 TexCoordsDimensions_[MAX_COUNT_OF_TEXTURES];
00076
00077 u8 TexLayerCount_;
00078
00079 static bool isTextureIntern_;
00080
00081 };
00082
00083
00084 }
00085
00086 }
00087
00088
00089 #endif
00090
00091 #endif
00092
00093
00094
00095