Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogre/Tools/3dsmaxExport/LEXIExporter/LexiExport/Sources/LexiOgreMeshCompiler.h @ 45

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

=…

File size: 2.8 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of LEXIExporter
4
5Copyright 2006 NDS Limited
6
7Author(s):
8Mark Folkenberg,
9Bo Krohn
10
11This program is free software; you can redistribute it and/or modify it under
12the terms of the GNU Lesser General Public License as published by the Free Software
13Foundation; either version 2 of the License, or (at your option) any later
14version.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public License along with
21this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22Place - Suite 330, Boston, MA 02111-1307, USA, or go to
23http://www.gnu.org/copyleft/lesser.txt.
24-----------------------------------------------------------------------------
25*/
26
27#include "LexiIntermediateAPI.h"
28#include "LexiOgreSkeletonCompiler.h"
29
30class COgreMeshCompiler
31{
32public:
33
34        COgreMeshCompiler( CIntermediateMesh* pIntermediateMesh, const CDDObject* pConfig, Ogre::String filename );
35        virtual ~COgreMeshCompiler();
36
37        bool                    WriteOgreMesh( const Ogre::String& sFilename );
38
39        Ogre::MeshPtr   GetOgreMesh( void );
40
41protected:
42
43        void    InitializeOgreComponents( void );
44
45        void    CreateOgreMesh( CIntermediateMesh* pIntermediateMesh );
46        void    CreateSubMeshes( CIntermediateMesh* pIntermediateMesh );
47        void    CreateBuffers( CIntermediateMesh* pIntermediateMesh );
48        void    CreateIndexBuffer( CIntermediateMesh* pIntermediateMesh );
49        void    CreateVertexBuffer( CIntermediateMesh* pIntermediateMesh );
50        void    CreateNormalBuffer( CIntermediateMesh* pIntermediateMesh );
51        void    CreateDiffuseBuffer( CIntermediateMesh* pIntermediateMesh );
52        void    CreateTexCoordBuffer( CIntermediateMesh* pIntermediateMesh );
53        void    CreatePoseBuffers( CIntermediateMesh* pIntermediateMesh );
54        void    CreateMeshBounds( void );
55        void    PrintVertexDataToLog( void );
56
57        void    SetBoneAssignments( const CTriangle& face, CIntermediateMesh* pIntermediateMesh );
58
59private:
60
61        void    ReadConfig( const CDDObject* pConfig );
62        void    ReindexIntermediateBuffers( CIntermediateMesh* pIntermediateMesh );
63
64        unsigned int CreatePose( CIntermediateMesh* pIntermediateMesh, Ogre::String name, unsigned int iFrame, bool bOptimize );
65        unsigned int m_iNrPoses;
66
67        Ogre::MeshPtr                   m_pOgreMesh;
68        Ogre::Real                              m_MaxSquaredLength;
69        Ogre::AxisAlignedBox    m_AABB;
70        int                                             m_iBind;
71
72        bool    m_bReindex;
73        bool    m_bExportNormals;
74        bool    m_bExportColours;
75        bool    m_bExportTexUVs;
76        bool    m_bExportSkeleton;
77
78        COgreSkeletonCompiler* m_pSkeletonCompiler;
79
80        Ogre::HardwareIndexBuffer::IndexType            m_IndexBitType;
81        std::map<CIntermediateMaterial*, Ogre::SubMesh*>        m_lMaterialSubMeshMap;
82
83        Ogre::HardwareVertexBufferSharedPtr vBuf;
84        unsigned int m_iNrVerts;
85
86};
Note: See TracBrowser for help on using the repository browser.