Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreMeshFileFormat.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __MeshFileFormat_H__
00026 #define __MeshFileFormat_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 namespace Ogre {
00031 
00048     enum MeshChunkID {
00049         M_HEADER                = 0x1000,
00050             // char*          version           : Version number check
00051         M_MESH                = 0x3000,
00052             // bool skeletallyAnimated   // important flag which affects h/w buffer policies
00053             // Optional M_GEOMETRY chunk
00054             M_SUBMESH             = 0x4000, 
00055                 // char* materialName
00056                 // bool useSharedVertices
00057                 // unsigned int indexCount
00058                 // bool indexes32Bit
00059                 // unsigned int* faceVertexIndices (indexCount)
00060                 // OR
00061                 // unsigned short* faceVertexIndices (indexCount)
00062                 // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)
00063                 M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing
00064                     // unsigned short operationType
00065                 M_SUBMESH_BONE_ASSIGNMENT = 0x4100,
00066                     // Optional bone weights (repeating section)
00067                     // unsigned int vertexIndex;
00068                     // unsigned short boneIndex;
00069                     // Real weight;
00070             M_GEOMETRY          = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH
00071                 // unsigned int vertexCount
00072                 // Real* pVertices (x, y, z order x numVertices)
00073                 M_GEOMETRY_NORMALS = 0x5100,    //(Optional)
00074                     // Real* pNormals (x, y, z order x numVertices)
00075                 M_GEOMETRY_COLOURS = 0x5200,    //(Optional)
00076                     // unsigned long* pColours (RGBA 8888 format x numVertices)
00077                 M_GEOMETRY_TEXCOORDS = 0x5300,    //(Optional, REPEATABLE, each one adds an extra set)
00078                     // unsigned short dimensions    (1 for 1D, 2 for 2D, 3 for 3D)
00079                     // Real* pTexCoords  (u [v] [w] order, dimensions x numVertices)
00080             M_MESH_SKELETON_LINK = 0x6000,
00081                 // Optional link to skeleton
00082                 // char* skeletonName           : name of .skeleton to use
00083             M_MESH_BONE_ASSIGNMENT = 0x7000,
00084                 // Optional bone weights (repeating section)
00085                 // unsigned int vertexIndex;
00086                 // unsigned short boneIndex;
00087                 // Real weight;
00088             M_MESH_LOD = 0x8000,
00089                 // Optional LOD information
00090                 // unsigned short numLevels;
00091                 // bool manual;  (true for manual alternate meshes, false for generated)
00092                 M_MESH_LOD_USAGE = 0x8100,
00093                 // Repeating section, ordered in increasing depth
00094                 // NB LOD 0 (full detail from 0 depth) is omitted
00095                 // Real fromSquaredDepth;
00096                     M_MESH_LOD_MANUAL = 0x8110,
00097                     // Required if M_MESH_LOD section manual = true
00098                     // String manualMeshName;
00099                     M_MESH_LOD_GENERATED = 0x8120,
00100                     // Required if M_MESH_LOD section manual = false
00101                     // Repeating section (1 per submesh)
00102                     // unsigned int indexCount;
00103                     // bool indexes32Bit
00104                     // unsigned short* faceIndexes;  (indexCount)
00105                     // OR
00106                     // unsigned int* faceIndexes;  (indexCount)
00107             M_MESH_BOUNDS = 0x9000
00108                 // Real minx, miny, minz
00109                 // Real maxx, maxy, maxz
00110                 // Real radius
00111                     
00112                     
00113         
00114         // --> Phased out definitions
00115         // Definitions required for loading 1.0 meshes, but no longer supported 
00116         // (see 1.0 format below)
00117         , M_MATERIAL            = 0x2000,
00118             // char* name 
00119             // AMBIENT
00120             // Real r, g, b
00121             // DIFFUSE
00122             // Real r, g, b
00123             // SPECULAR
00124             // Real r, g, b
00125             // SHININESS
00126             // Real val;
00127             M_TEXTURE_LAYER    = 0x2200 // optional, repeat per layer
00128                 // char* name 
00129                 // TODO - scale, offset, effects
00130 
00131     };
00132 
00133     /* Version 1.0 of the .mesh fornmat (deprecated)
00134     enum MeshChunkID {
00135         M_HEADER                = 0x1000,
00136             // char*          version           : Version number check
00137         M_MATERIAL            = 0x2000,
00138             // char* name 
00139             // AMBIENT
00140             // Real r, g, b
00141             // DIFFUSE
00142             // Real r, g, b
00143             // SPECULAR
00144             // Real r, g, b
00145             // SHININESS
00146             // Real val;
00147             M_TEXTURE_LAYER    = 0x2200, // optional, repeat per layer
00148                 // char* name 
00149                 // TODO - scale, offset, effects
00150         M_MESH                = 0x3000,
00151             // M_GEOMETRY chunk
00152             M_SUBMESH             = 0x4000, 
00153                 // char* materialName
00154                 // bool useSharedVertices
00155                 // unsigned short numFaces
00156                 // unsigned short* faceVertexIndices ((v1, v2, v3) * numFaces)
00157                 // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)
00158                 M_SUBMESH_BONE_ASSIGNMENT = 0x4100,
00159                     // Optional bone weights (repeating section)
00160                     // unsigned short vertexIndex;
00161                     // unsigned short boneIndex;
00162                     // Real weight;
00163             M_GEOMETRY          = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH
00164                 // unsigned short numVertices
00165                 // Real* pVertices (x, y, z order x numVertices)
00166                 M_GEOMETRY_NORMALS = 0x5100,    //(Optional)
00167                     // Real* pNormals (x, y, z order x numVertices)
00168                 M_GEOMETRY_COLOURS = 0x5200,    //(Optional)
00169                     // unsigned long* pColours (RGBA 8888 format x numVertices)
00170                 M_GEOMETRY_TEXCOORDS = 0x5300,    //(Optional, REPEATABLE, each one adds an extra set)
00171                     // unsigned short dimensions    (1 for 1D, 2 for 2D, 3 for 3D)
00172                     // Real* pTexCoords  (u [v] [w] order, dimensions x numVertices)
00173             M_MESH_SKELETON_LINK = 0x6000,
00174                 // Optional link to skeleton
00175                 // char* skeletonName           : name of .skeleton to use
00176             M_MESH_BONE_ASSIGNMENT = 0x7000,
00177                 // Optional bone weights (repeating section)
00178                 // unsigned short vertexIndex;
00179                 // unsigned short boneIndex;
00180                 // Real weight;
00181             M_MESH_LOD = 0x8000,
00182                 // Optional LOD information
00183                 // unsigned short numLevels;
00184                 // bool manual;  (true for manual alternate meshes, false for generated)
00185                 M_MESH_LOD_USAGE = 0x8100,
00186                 // Repeating section, ordered in increasing depth
00187                 // NB LOD 0 (full detail from 0 depth) is omitted
00188                 // Real fromSquaredDepth;
00189                     M_MESH_LOD_MANUAL = 0x8110,
00190                     // Required if M_MESH_LOD section manual = true
00191                     // String manualMeshName;
00192                     M_MESH_LOD_GENERATED = 0x8120
00193                     // Required if M_MESH_LOD section manual = false
00194                     // Repeating section (1 per submesh)
00195                     // unsigned short numFaces;
00196                     // unsigned short* faceIndexes;  ((v1, v2, v3) * numFaces)
00197                     
00198                     
00199 
00200 
00201                 
00202 
00203 
00204     };
00205 */
00206 } // namespace
00207 
00208 
00209 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:18 2004