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 (c) 2000-2005 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 00049 enum MeshChunkID { 00050 M_HEADER = 0x1000, 00051 // char* version : Version number check 00052 M_MESH = 0x3000, 00053 // bool skeletallyAnimated // important flag which affects h/w buffer policies 00054 // Optional M_GEOMETRY chunk 00055 M_SUBMESH = 0x4000, 00056 // char* materialName 00057 // bool useSharedVertices 00058 // unsigned int indexCount 00059 // bool indexes32Bit 00060 // unsigned int* faceVertexIndices (indexCount) 00061 // OR 00062 // unsigned short* faceVertexIndices (indexCount) 00063 // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false) 00064 M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing 00065 // unsigned short operationType 00066 M_SUBMESH_BONE_ASSIGNMENT = 0x4100, 00067 // Optional bone weights (repeating section) 00068 // unsigned int vertexIndex; 00069 // unsigned short boneIndex; 00070 // float weight; 00071 M_GEOMETRY = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH 00072 // unsigned int vertexCount 00073 M_GEOMETRY_VERTEX_DECLARATION = 0x5100, 00074 M_GEOMETRY_VERTEX_ELEMENT = 0x5110, // Repeating section 00075 // unsigned short source; // buffer bind source 00076 // unsigned short type; // VertexElementType 00077 // unsigned short semantic; // VertexElementSemantic 00078 // unsigned short offset; // start offset in buffer in bytes 00079 // unsigned short index; // index of the semantic (for colours and texture coords) 00080 M_GEOMETRY_VERTEX_BUFFER = 0x5200, // Repeating section 00081 // unsigned short bindIndex; // Index to bind this buffer to 00082 // unsigned short vertexSize; // Per-vertex size, must agree with declaration at this index 00083 M_GEOMETRY_VERTEX_BUFFER_DATA = 0x5210, 00084 // raw buffer data 00085 M_MESH_SKELETON_LINK = 0x6000, 00086 // Optional link to skeleton 00087 // char* skeletonName : name of .skeleton to use 00088 M_MESH_BONE_ASSIGNMENT = 0x7000, 00089 // Optional bone weights (repeating section) 00090 // unsigned int vertexIndex; 00091 // unsigned short boneIndex; 00092 // float weight; 00093 M_MESH_LOD = 0x8000, 00094 // Optional LOD information 00095 // unsigned short numLevels; 00096 // bool manual; (true for manual alternate meshes, false for generated) 00097 M_MESH_LOD_USAGE = 0x8100, 00098 // Repeating section, ordered in increasing depth 00099 // NB LOD 0 (full detail from 0 depth) is omitted 00100 // float fromSquaredDepth; 00101 M_MESH_LOD_MANUAL = 0x8110, 00102 // Required if M_MESH_LOD section manual = true 00103 // String manualMeshName; 00104 M_MESH_LOD_GENERATED = 0x8120, 00105 // Required if M_MESH_LOD section manual = false 00106 // Repeating section (1 per submesh) 00107 // unsigned int indexCount; 00108 // bool indexes32Bit 00109 // unsigned short* faceIndexes; (indexCount) 00110 // OR 00111 // unsigned int* faceIndexes; (indexCount) 00112 M_MESH_BOUNDS = 0x9000, 00113 // float minx, miny, minz 00114 // float maxx, maxy, maxz 00115 // float radius 00116 00117 // Added By DrEvil 00118 // optional chunk that contains a table of submesh indexes and the names of 00119 // the sub-meshes. 00120 M_SUBMESH_NAME_TABLE = 0xA000, 00121 // Subchunks of the name table. Each chunk contains an index & string 00122 M_SUBMESH_NAME_TABLE_ELEMENT = 0xA100, 00123 // short index 00124 // char* name 00125 00126 // Optional chunk which stores precomputed edge data 00127 M_EDGE_LISTS = 0xB000, 00128 // Each LOD has a separate edge list 00129 M_EDGE_LIST_LOD = 0xB100, 00130 // unsigned short lodIndex 00131 // bool isManual // If manual, no edge data here, loaded from manual mesh 00132 // unsigned long numTriangles 00133 // unsigned long numEdgeGroups 00134 // Triangle* triangleList 00135 // unsigned long indexSet 00136 // unsigned long vertexSet 00137 // unsigned long vertIndex[3] 00138 // unsigned long sharedVertIndex[3] 00139 // float normal[4] 00140 00141 M_EDGE_GROUP = 0xB110, 00142 // unsigned long vertexSet 00143 // unsigned long numEdges 00144 // Edge* edgeList 00145 // unsigned long triIndex[2] 00146 // unsigned long vertIndex[2] 00147 // unsigned long sharedVertIndex[2] 00148 // bool degenerate 00149 00150 00151 /* Version 1.2 of the .mesh fornmat (deprecated) 00152 enum MeshChunkID { 00153 M_HEADER = 0x1000, 00154 // char* version : Version number check 00155 M_MESH = 0x3000, 00156 // bool skeletallyAnimated // important flag which affects h/w buffer policies 00157 // Optional M_GEOMETRY chunk 00158 M_SUBMESH = 0x4000, 00159 // char* materialName 00160 // bool useSharedVertices 00161 // unsigned int indexCount 00162 // bool indexes32Bit 00163 // unsigned int* faceVertexIndices (indexCount) 00164 // OR 00165 // unsigned short* faceVertexIndices (indexCount) 00166 // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false) 00167 M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing 00168 // unsigned short operationType 00169 M_SUBMESH_BONE_ASSIGNMENT = 0x4100, 00170 // Optional bone weights (repeating section) 00171 // unsigned int vertexIndex; 00172 // unsigned short boneIndex; 00173 // float weight; 00174 M_GEOMETRY = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH 00175 */ 00176 // unsigned int vertexCount 00177 // float* pVertices (x, y, z order x numVertices) 00178 M_GEOMETRY_NORMALS = 0x5100, //(Optional) 00179 // float* pNormals (x, y, z order x numVertices) 00180 M_GEOMETRY_COLOURS = 0x5200, //(Optional) 00181 // unsigned long* pColours (RGBA 8888 format x numVertices) 00182 M_GEOMETRY_TEXCOORDS = 0x5300, //(Optional, REPEATABLE, each one adds an extra set) 00183 // unsigned short dimensions (1 for 1D, 2 for 2D, 3 for 3D) 00184 // float* pTexCoords (u [v] [w] order, dimensions x numVertices) 00185 /* 00186 M_MESH_SKELETON_LINK = 0x6000, 00187 // Optional link to skeleton 00188 // char* skeletonName : name of .skeleton to use 00189 M_MESH_BONE_ASSIGNMENT = 0x7000, 00190 // Optional bone weights (repeating section) 00191 // unsigned int vertexIndex; 00192 // unsigned short boneIndex; 00193 // float weight; 00194 M_MESH_LOD = 0x8000, 00195 // Optional LOD information 00196 // unsigned short numLevels; 00197 // bool manual; (true for manual alternate meshes, false for generated) 00198 M_MESH_LOD_USAGE = 0x8100, 00199 // Repeating section, ordered in increasing depth 00200 // NB LOD 0 (full detail from 0 depth) is omitted 00201 // float fromSquaredDepth; 00202 M_MESH_LOD_MANUAL = 0x8110, 00203 // Required if M_MESH_LOD section manual = true 00204 // String manualMeshName; 00205 M_MESH_LOD_GENERATED = 0x8120, 00206 // Required if M_MESH_LOD section manual = false 00207 // Repeating section (1 per submesh) 00208 // unsigned int indexCount; 00209 // bool indexes32Bit 00210 // unsigned short* faceIndexes; (indexCount) 00211 // OR 00212 // unsigned int* faceIndexes; (indexCount) 00213 M_MESH_BOUNDS = 0x9000 00214 // float minx, miny, minz 00215 // float maxx, maxy, maxz 00216 // float radius 00217 00218 // Added By DrEvil 00219 // optional chunk that contains a table of submesh indexes and the names of 00220 // the sub-meshes. 00221 M_SUBMESH_NAME_TABLE, 00222 // Subchunks of the name table. Each chunk contains an index & string 00223 M_SUBMESH_NAME_TABLE_ELEMENT, 00224 // short index 00225 // char* name 00226 */ 00227 }; 00228 } // namespace 00229 00230 00231 #endif
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:48 2006