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 // Added By DrEvil 00132 // optional chunk that contains a table of submesh indexes and the names of 00133 // the sub-meshes. 00134 M_SUBMESH_NAME_TABLE, 00135 // Subchunks of the name table. Each chunk contains an index & string 00136 M_SUBMESH_NAME_TABLE_ELEMENT, 00137 // short index 00138 // char* name 00139 00140 }; 00141 00142 /* Version 1.0 of the .mesh fornmat (deprecated) 00143 enum MeshChunkID { 00144 M_HEADER = 0x1000, 00145 // char* version : Version number check 00146 M_MATERIAL = 0x2000, 00147 // char* name 00148 // AMBIENT 00149 // Real r, g, b 00150 // DIFFUSE 00151 // Real r, g, b 00152 // SPECULAR 00153 // Real r, g, b 00154 // SHININESS 00155 // Real val; 00156 M_TEXTURE_LAYER = 0x2200, // optional, repeat per layer 00157 // char* name 00158 // TODO - scale, offset, effects 00159 M_MESH = 0x3000, 00160 // M_GEOMETRY chunk 00161 M_SUBMESH = 0x4000, 00162 // char* materialName 00163 // bool useSharedVertices 00164 // unsigned short numFaces 00165 // unsigned short* faceVertexIndices ((v1, v2, v3) * numFaces) 00166 // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false) 00167 M_SUBMESH_BONE_ASSIGNMENT = 0x4100, 00168 // Optional bone weights (repeating section) 00169 // unsigned short vertexIndex; 00170 // unsigned short boneIndex; 00171 // Real weight; 00172 M_GEOMETRY = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH 00173 // unsigned short numVertices 00174 // Real* pVertices (x, y, z order x numVertices) 00175 M_GEOMETRY_NORMALS = 0x5100, //(Optional) 00176 // Real* pNormals (x, y, z order x numVertices) 00177 M_GEOMETRY_COLOURS = 0x5200, //(Optional) 00178 // unsigned long* pColours (RGBA 8888 format x numVertices) 00179 M_GEOMETRY_TEXCOORDS = 0x5300, //(Optional, REPEATABLE, each one adds an extra set) 00180 // unsigned short dimensions (1 for 1D, 2 for 2D, 3 for 3D) 00181 // Real* pTexCoords (u [v] [w] order, dimensions x numVertices) 00182 M_MESH_SKELETON_LINK = 0x6000, 00183 // Optional link to skeleton 00184 // char* skeletonName : name of .skeleton to use 00185 M_MESH_BONE_ASSIGNMENT = 0x7000, 00186 // Optional bone weights (repeating section) 00187 // unsigned short vertexIndex; 00188 // unsigned short boneIndex; 00189 // Real weight; 00190 M_MESH_LOD = 0x8000, 00191 // Optional LOD information 00192 // unsigned short numLevels; 00193 // bool manual; (true for manual alternate meshes, false for generated) 00194 M_MESH_LOD_USAGE = 0x8100, 00195 // Repeating section, ordered in increasing depth 00196 // NB LOD 0 (full detail from 0 depth) is omitted 00197 // Real fromSquaredDepth; 00198 M_MESH_LOD_MANUAL = 0x8110, 00199 // Required if M_MESH_LOD section manual = true 00200 // String manualMeshName; 00201 M_MESH_LOD_GENERATED = 0x8120 00202 // Required if M_MESH_LOD section manual = false 00203 // Repeating section (1 per submesh) 00204 // unsigned short numFaces; 00205 // unsigned short* faceIndexes; ((v1, v2, v3) * numFaces) 00206 00207 00208 00209 00210 00211 00212 00213 }; 00214 */ 00215 } // namespace 00216 00217 00218 #endif
Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:22:25 2004