Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/Tools/3dsmaxExport/OgreExport/include/OgreMaxMeshXMLExport.h @ 6

Last change on this file since 6 was 6, checked in by anonymous, 17 years ago

=…

File size: 2.7 KB
RevLine 
[6]1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25
26#if !defined(__OGREMAX_MESHXML_EXPORTER_H__)
27#define __OGREMAX_MESHXML_EXPORTER_H__
28
29#include "OgreMaxConfig.h"
30#include "OgreMaxExport.h"
31
32#include <string>
33#include <queue>
34#include <map>
35#include "tab.h"
36
37class MaterialMap;
38class IGameScene;
39class IGameNode;
40class IGameObject;
41class IGameMaterial;
42
43namespace OgreMax {
44
45        class MeshXMLExporter  : public OgreMaxExporter, public ITreeEnumProc
46        {
47                typedef struct {
48                        std::string name;
49                        int start;
50                        int end;
51                } NamedAnimation;
52
53        public:
54                typedef std::map< std::string, std::string > OutputMap;
55
56                MeshXMLExporter(const Config& config, MaterialMap& materialMap);
57                virtual ~MeshXMLExporter();
58
59                // generates a list of INode* for assembly into Ogre::Mesh form; returns
60                // a map of filename --> XML stringstream.
61                bool buildMeshXML(OutputMap& output);
62
63        protected:
64                // mesh file stream functions
65                bool streamFileHeader(std::ostream &of);
66                bool streamFileFooter(std::ostream &of);
67                bool streamSubmesh(std::ostream &of, IGameObject *obj, std::string &mtlName);
68                bool streamBoneAssignments(std::ostream &of, Modifier *mod, IGameNode *node);
69
70                int getBoneIndex(char *name);
71                std::string removeSpaces(const std::string &s);
72
73                int callback(INode *node);
74
75        private:
76
77                bool export(OutputMap& output);
78
79                bool m_createSkeletonLink;
80                std::string m_exportFilename;                   // filename provided by
81                std::string m_filename;                 // filename provided by
82                std::string m_skeletonFilename;
83                std::queue< std::string > m_submeshNames;
84                MaterialMap& m_materialMap;
85                std::map< std::string, int > m_boneIndexMap;
86                int m_currentBoneIndex;
87
88                IGameScene*     m_pGame;
89                Tab<INode*> m_nodeTab;
90        };
91}
92
93#endif
Note: See TracBrowser for help on using the repository browser.