1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreMeshFileFormat.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
10 | <h1>OgreMeshFileFormat.h</h1><a href="OgreMeshFileFormat_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
15 | 00006 <span class="comment"></span> |
---|
16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
18 | 00009 <span class="comment"></span> |
---|
19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
20 | 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> |
---|
21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
22 | 00013 <span class="comment">version.</span> |
---|
23 | 00014 <span class="comment"></span> |
---|
24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> |
---|
27 | 00018 <span class="comment"></span> |
---|
28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> |
---|
29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
33 | 00024 <span class="comment">*/</span> |
---|
34 | 00025 <span class="preprocessor">#ifndef __MeshFileFormat_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __MeshFileFormat_H__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
38 | 00029 |
---|
39 | 00030 <span class="keyword">namespace </span>Ogre { |
---|
40 | 00031 |
---|
41 | <a name="l00049"></a><a class="code" href="namespaceOgre.html#a662">00049</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a662">MeshChunkID</a> { |
---|
42 | 00050 <a class="code" href="namespaceOgre.html#a662a324">M_HEADER</a> = 0x1000, |
---|
43 | 00051 <span class="comment">// char* version : Version number check</span> |
---|
44 | 00052 <a class="code" href="namespaceOgre.html#a662a325">M_MESH</a> = 0x3000, |
---|
45 | 00053 <span class="comment">// bool skeletallyAnimated // important flag which affects h/w buffer policies</span> |
---|
46 | 00054 <span class="comment">// Optional M_GEOMETRY chunk</span> |
---|
47 | 00055 <a class="code" href="namespaceOgre.html#a662a326">M_SUBMESH</a> = 0x4000, |
---|
48 | 00056 <span class="comment">// char* materialName</span> |
---|
49 | 00057 <span class="comment">// bool useSharedVertices</span> |
---|
50 | 00058 <span class="comment">// unsigned int indexCount</span> |
---|
51 | 00059 <span class="comment">// bool indexes32Bit</span> |
---|
52 | 00060 <span class="comment">// unsigned int* faceVertexIndices (indexCount)</span> |
---|
53 | 00061 <span class="comment">// OR</span> |
---|
54 | 00062 <span class="comment">// unsigned short* faceVertexIndices (indexCount)</span> |
---|
55 | 00063 <span class="comment">// M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)</span> |
---|
56 | 00064 <a class="code" href="namespaceOgre.html#a662a327">M_SUBMESH_OPERATION</a> = 0x4010, <span class="comment">// optional, trilist assumed if missing</span> |
---|
57 | 00065 <span class="comment">// unsigned short operationType</span> |
---|
58 | 00066 <a class="code" href="namespaceOgre.html#a662a328">M_SUBMESH_BONE_ASSIGNMENT</a> = 0x4100, |
---|
59 | 00067 <span class="comment">// Optional bone weights (repeating section)</span> |
---|
60 | 00068 <span class="comment">// unsigned int vertexIndex;</span> |
---|
61 | 00069 <span class="comment">// unsigned short boneIndex;</span> |
---|
62 | 00070 <span class="comment">// float weight;</span> |
---|
63 | 00071 <a class="code" href="namespaceOgre.html#a662a329">M_GEOMETRY</a> = 0x5000, <span class="comment">// NB this chunk is embedded within M_MESH and M_SUBMESH</span> |
---|
64 | 00072 <span class="comment">// unsigned int vertexCount</span> |
---|
65 | 00073 <a class="code" href="namespaceOgre.html#a662a330">M_GEOMETRY_VERTEX_DECLARATION</a> = 0x5100, |
---|
66 | 00074 <a class="code" href="namespaceOgre.html#a662a331">M_GEOMETRY_VERTEX_ELEMENT</a> = 0x5110, <span class="comment">// Repeating section</span> |
---|
67 | 00075 <span class="comment">// unsigned short source; // buffer bind source</span> |
---|
68 | 00076 <span class="comment">// unsigned short type; // VertexElementType</span> |
---|
69 | 00077 <span class="comment">// unsigned short semantic; // VertexElementSemantic</span> |
---|
70 | 00078 <span class="comment">// unsigned short offset; // start offset in buffer in bytes</span> |
---|
71 | 00079 <span class="comment">// unsigned short index; // index of the semantic (for colours and texture coords)</span> |
---|
72 | 00080 <a class="code" href="namespaceOgre.html#a662a332">M_GEOMETRY_VERTEX_BUFFER</a> = 0x5200, <span class="comment">// Repeating section</span> |
---|
73 | 00081 <span class="comment">// unsigned short bindIndex; // Index to bind this buffer to</span> |
---|
74 | 00082 <span class="comment">// unsigned short vertexSize; // Per-vertex size, must agree with declaration at this index</span> |
---|
75 | 00083 <a class="code" href="namespaceOgre.html#a662a333">M_GEOMETRY_VERTEX_BUFFER_DATA</a> = 0x5210, |
---|
76 | 00084 <span class="comment">// raw buffer data</span> |
---|
77 | 00085 <a class="code" href="namespaceOgre.html#a662a334">M_MESH_SKELETON_LINK</a> = 0x6000, |
---|
78 | 00086 <span class="comment">// Optional link to skeleton</span> |
---|
79 | 00087 <span class="comment">// char* skeletonName : name of .skeleton to use</span> |
---|
80 | 00088 <a class="code" href="namespaceOgre.html#a662a335">M_MESH_BONE_ASSIGNMENT</a> = 0x7000, |
---|
81 | 00089 <span class="comment">// Optional bone weights (repeating section)</span> |
---|
82 | 00090 <span class="comment">// unsigned int vertexIndex;</span> |
---|
83 | 00091 <span class="comment">// unsigned short boneIndex;</span> |
---|
84 | 00092 <span class="comment">// float weight;</span> |
---|
85 | 00093 <a class="code" href="namespaceOgre.html#a662a336">M_MESH_LOD</a> = 0x8000, |
---|
86 | 00094 <span class="comment">// Optional LOD information</span> |
---|
87 | 00095 <span class="comment">// unsigned short numLevels;</span> |
---|
88 | 00096 <span class="comment">// bool manual; (true for manual alternate meshes, false for generated)</span> |
---|
89 | 00097 <a class="code" href="namespaceOgre.html#a662a337">M_MESH_LOD_USAGE</a> = 0x8100, |
---|
90 | 00098 <span class="comment">// Repeating section, ordered in increasing depth</span> |
---|
91 | 00099 <span class="comment">// NB LOD 0 (full detail from 0 depth) is omitted</span> |
---|
92 | 00100 <span class="comment">// float fromSquaredDepth;</span> |
---|
93 | 00101 <a class="code" href="namespaceOgre.html#a662a338">M_MESH_LOD_MANUAL</a> = 0x8110, |
---|
94 | 00102 <span class="comment">// Required if M_MESH_LOD section manual = true</span> |
---|
95 | 00103 <span class="comment">// String manualMeshName;</span> |
---|
96 | 00104 <a class="code" href="namespaceOgre.html#a662a339">M_MESH_LOD_GENERATED</a> = 0x8120, |
---|
97 | 00105 <span class="comment">// Required if M_MESH_LOD section manual = false</span> |
---|
98 | 00106 <span class="comment">// Repeating section (1 per submesh)</span> |
---|
99 | 00107 <span class="comment">// unsigned int indexCount;</span> |
---|
100 | 00108 <span class="comment">// bool indexes32Bit</span> |
---|
101 | 00109 <span class="comment">// unsigned short* faceIndexes; (indexCount)</span> |
---|
102 | 00110 <span class="comment">// OR</span> |
---|
103 | 00111 <span class="comment">// unsigned int* faceIndexes; (indexCount)</span> |
---|
104 | 00112 <a class="code" href="namespaceOgre.html#a662a340">M_MESH_BOUNDS</a> = 0x9000, |
---|
105 | 00113 <span class="comment">// float minx, miny, minz</span> |
---|
106 | 00114 <span class="comment">// float maxx, maxy, maxz</span> |
---|
107 | 00115 <span class="comment">// float radius</span> |
---|
108 | 00116 |
---|
109 | 00117 <span class="comment">// Added By DrEvil</span> |
---|
110 | 00118 <span class="comment">// optional chunk that contains a table of submesh indexes and the names of</span> |
---|
111 | 00119 <span class="comment">// the sub-meshes.</span> |
---|
112 | 00120 <a class="code" href="namespaceOgre.html#a662a341">M_SUBMESH_NAME_TABLE</a> = 0xA000, |
---|
113 | 00121 <span class="comment">// Subchunks of the name table. Each chunk contains an index & string</span> |
---|
114 | 00122 <a class="code" href="namespaceOgre.html#a662a342">M_SUBMESH_NAME_TABLE_ELEMENT</a> = 0xA100, |
---|
115 | 00123 <span class="comment">// short index</span> |
---|
116 | 00124 <span class="comment">// char* name</span> |
---|
117 | 00125 |
---|
118 | 00126 <span class="comment">// Optional chunk which stores precomputed edge data </span> |
---|
119 | 00127 <a class="code" href="namespaceOgre.html#a662a343">M_EDGE_LISTS</a> = 0xB000, |
---|
120 | 00128 <span class="comment">// Each LOD has a separate edge list</span> |
---|
121 | 00129 <a class="code" href="namespaceOgre.html#a662a344">M_EDGE_LIST_LOD</a> = 0xB100, |
---|
122 | 00130 <span class="comment">// unsigned short lodIndex</span> |
---|
123 | 00131 <span class="comment">// bool isManual // If manual, no edge data here, loaded from manual mesh</span> |
---|
124 | 00132 <span class="comment">// unsigned long numTriangles</span> |
---|
125 | 00133 <span class="comment">// unsigned long numEdgeGroups</span> |
---|
126 | 00134 <span class="comment">// Triangle* triangleList</span> |
---|
127 | 00135 <span class="comment">// unsigned long indexSet</span> |
---|
128 | 00136 <span class="comment">// unsigned long vertexSet</span> |
---|
129 | 00137 <span class="comment">// unsigned long vertIndex[3]</span> |
---|
130 | 00138 <span class="comment">// unsigned long sharedVertIndex[3] </span> |
---|
131 | 00139 <span class="comment">// float normal[4] </span> |
---|
132 | 00140 |
---|
133 | 00141 <a class="code" href="namespaceOgre.html#a662a345">M_EDGE_GROUP</a> = 0xB110, |
---|
134 | 00142 <span class="comment">// unsigned long vertexSet</span> |
---|
135 | 00143 <span class="comment">// unsigned long numEdges</span> |
---|
136 | 00144 <span class="comment">// Edge* edgeList</span> |
---|
137 | 00145 <span class="comment">// unsigned long triIndex[2]</span> |
---|
138 | 00146 <span class="comment">// unsigned long vertIndex[2]</span> |
---|
139 | 00147 <span class="comment">// unsigned long sharedVertIndex[2]</span> |
---|
140 | 00148 <span class="comment">// bool degenerate</span> |
---|
141 | 00149 |
---|
142 | 00150 |
---|
143 | 00151 <span class="comment">/* Version 1.2 of the .mesh fornmat (deprecated)</span> |
---|
144 | 00152 <span class="comment"> enum MeshChunkID {</span> |
---|
145 | 00153 <span class="comment"> M_HEADER = 0x1000,</span> |
---|
146 | 00154 <span class="comment"> // char* version : Version number check</span> |
---|
147 | 00155 <span class="comment"> M_MESH = 0x3000,</span> |
---|
148 | 00156 <span class="comment"> // bool skeletallyAnimated // important flag which affects h/w buffer policies</span> |
---|
149 | 00157 <span class="comment"> // Optional M_GEOMETRY chunk</span> |
---|
150 | 00158 <span class="comment"> M_SUBMESH = 0x4000, </span> |
---|
151 | 00159 <span class="comment"> // char* materialName</span> |
---|
152 | 00160 <span class="comment"> // bool useSharedVertices</span> |
---|
153 | 00161 <span class="comment"> // unsigned int indexCount</span> |
---|
154 | 00162 <span class="comment"> // bool indexes32Bit</span> |
---|
155 | 00163 <span class="comment"> // unsigned int* faceVertexIndices (indexCount)</span> |
---|
156 | 00164 <span class="comment"> // OR</span> |
---|
157 | 00165 <span class="comment"> // unsigned short* faceVertexIndices (indexCount)</span> |
---|
158 | 00166 <span class="comment"> // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)</span> |
---|
159 | 00167 <span class="comment"> M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing</span> |
---|
160 | 00168 <span class="comment"> // unsigned short operationType</span> |
---|
161 | 00169 <span class="comment"> M_SUBMESH_BONE_ASSIGNMENT = 0x4100,</span> |
---|
162 | 00170 <span class="comment"> // Optional bone weights (repeating section)</span> |
---|
163 | 00171 <span class="comment"> // unsigned int vertexIndex;</span> |
---|
164 | 00172 <span class="comment"> // unsigned short boneIndex;</span> |
---|
165 | 00173 <span class="comment"> // float weight;</span> |
---|
166 | 00174 <span class="comment"> M_GEOMETRY = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH</span> |
---|
167 | 00175 <span class="comment"> */</span> |
---|
168 | 00176 <span class="comment">// unsigned int vertexCount</span> |
---|
169 | 00177 <span class="comment">// float* pVertices (x, y, z order x numVertices)</span> |
---|
170 | 00178 <a class="code" href="namespaceOgre.html#a662a346">M_GEOMETRY_NORMALS</a> = 0x5100, <span class="comment">//(Optional)</span> |
---|
171 | 00179 <span class="comment">// float* pNormals (x, y, z order x numVertices)</span> |
---|
172 | 00180 <a class="code" href="namespaceOgre.html#a662a347">M_GEOMETRY_COLOURS</a> = 0x5200, <span class="comment">//(Optional)</span> |
---|
173 | 00181 <span class="comment">// unsigned long* pColours (RGBA 8888 format x numVertices)</span> |
---|
174 | 00182 <a class="code" href="namespaceOgre.html#a662a348">M_GEOMETRY_TEXCOORDS</a> = 0x5300, <span class="comment">//(Optional, REPEATABLE, each one adds an extra set)</span> |
---|
175 | 00183 <span class="comment">// unsigned short dimensions (1 for 1D, 2 for 2D, 3 for 3D)</span> |
---|
176 | 00184 <span class="comment">// float* pTexCoords (u [v] [w] order, dimensions x numVertices)</span> |
---|
177 | 00185 <span class="comment">/*</span> |
---|
178 | 00186 <span class="comment"> M_MESH_SKELETON_LINK = 0x6000,</span> |
---|
179 | 00187 <span class="comment"> // Optional link to skeleton</span> |
---|
180 | 00188 <span class="comment"> // char* skeletonName : name of .skeleton to use</span> |
---|
181 | 00189 <span class="comment"> M_MESH_BONE_ASSIGNMENT = 0x7000,</span> |
---|
182 | 00190 <span class="comment"> // Optional bone weights (repeating section)</span> |
---|
183 | 00191 <span class="comment"> // unsigned int vertexIndex;</span> |
---|
184 | 00192 <span class="comment"> // unsigned short boneIndex;</span> |
---|
185 | 00193 <span class="comment"> // float weight;</span> |
---|
186 | 00194 <span class="comment"> M_MESH_LOD = 0x8000,</span> |
---|
187 | 00195 <span class="comment"> // Optional LOD information</span> |
---|
188 | 00196 <span class="comment"> // unsigned short numLevels;</span> |
---|
189 | 00197 <span class="comment"> // bool manual; (true for manual alternate meshes, false for generated)</span> |
---|
190 | 00198 <span class="comment"> M_MESH_LOD_USAGE = 0x8100,</span> |
---|
191 | 00199 <span class="comment"> // Repeating section, ordered in increasing depth</span> |
---|
192 | 00200 <span class="comment"> // NB LOD 0 (full detail from 0 depth) is omitted</span> |
---|
193 | 00201 <span class="comment"> // float fromSquaredDepth;</span> |
---|
194 | 00202 <span class="comment"> M_MESH_LOD_MANUAL = 0x8110,</span> |
---|
195 | 00203 <span class="comment"> // Required if M_MESH_LOD section manual = true</span> |
---|
196 | 00204 <span class="comment"> // String manualMeshName;</span> |
---|
197 | 00205 <span class="comment"> M_MESH_LOD_GENERATED = 0x8120,</span> |
---|
198 | 00206 <span class="comment"> // Required if M_MESH_LOD section manual = false</span> |
---|
199 | 00207 <span class="comment"> // Repeating section (1 per submesh)</span> |
---|
200 | 00208 <span class="comment"> // unsigned int indexCount;</span> |
---|
201 | 00209 <span class="comment"> // bool indexes32Bit</span> |
---|
202 | 00210 <span class="comment"> // unsigned short* faceIndexes; (indexCount)</span> |
---|
203 | 00211 <span class="comment"> // OR</span> |
---|
204 | 00212 <span class="comment"> // unsigned int* faceIndexes; (indexCount)</span> |
---|
205 | 00213 <span class="comment"> M_MESH_BOUNDS = 0x9000</span> |
---|
206 | 00214 <span class="comment"> // float minx, miny, minz</span> |
---|
207 | 00215 <span class="comment"> // float maxx, maxy, maxz</span> |
---|
208 | 00216 <span class="comment"> // float radius</span> |
---|
209 | 00217 <span class="comment"></span> |
---|
210 | 00218 <span class="comment"> // Added By DrEvil</span> |
---|
211 | 00219 <span class="comment"> // optional chunk that contains a table of submesh indexes and the names of</span> |
---|
212 | 00220 <span class="comment"> // the sub-meshes.</span> |
---|
213 | 00221 <span class="comment"> M_SUBMESH_NAME_TABLE,</span> |
---|
214 | 00222 <span class="comment"> // Subchunks of the name table. Each chunk contains an index & string</span> |
---|
215 | 00223 <span class="comment"> M_SUBMESH_NAME_TABLE_ELEMENT,</span> |
---|
216 | 00224 <span class="comment"> // short index</span> |
---|
217 | 00225 <span class="comment"> // char* name</span> |
---|
218 | 00226 <span class="comment"> */</span> |
---|
219 | 00227 }; |
---|
220 | 00228 } <span class="comment">// namespace</span> |
---|
221 | 00229 |
---|
222 | 00230 |
---|
223 | 00231 <span class="preprocessor">#endif</span> |
---|
224 | </pre></div><hr> |
---|
225 | <p> |
---|
226 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
227 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
228 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
229 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
230 | <Work rdf:about=""> |
---|
231 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
232 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
233 | </Work> |
---|
234 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
235 | |
---|
236 | Last modified Sun Feb 12 12:59:48 2006 |
---|
237 | </p> |
---|
238 | </body> |
---|
239 | </html> |
---|