source: OGRE/trunk/ogrenew/Docs/api/html/OgreMeshFileFormat_8h-source.html @ 657

Revision 657, 20.9 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;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>
1100002 <span class="comment">-----------------------------------------------------------------------------</span>
1200003 <span class="comment">This source file is part of OGRE</span>
1300004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
1400005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
1500006 <span class="comment"></span>
1600007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
1700008 <span class="comment">Also see acknowledgements in Readme.html</span>
1800009 <span class="comment"></span>
1900010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
2000011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
2100012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
2200013 <span class="comment">version.</span>
2300014 <span class="comment"></span>
2400015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
2500016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
2600017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
2700018 <span class="comment"></span>
2800019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
2900020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
3000021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
3100022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
3200023 <span class="comment">-----------------------------------------------------------------------------</span>
3300024 <span class="comment">*/</span>
3400025 <span class="preprocessor">#ifndef __MeshFileFormat_H__</span>
3500026 <span class="preprocessor"></span><span class="preprocessor">#define __MeshFileFormat_H__</span>
3600027 <span class="preprocessor"></span>
3700028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span>
3800029
3900030 <span class="keyword">namespace </span>Ogre {
4000031
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> {
4200050         <a class="code" href="namespaceOgre.html#a662a324">M_HEADER</a>                = 0x1000,
4300051             <span class="comment">// char*          version           : Version number check</span>
4400052         <a class="code" href="namespaceOgre.html#a662a325">M_MESH</a>                = 0x3000,
4500053             <span class="comment">// bool skeletallyAnimated   // important flag which affects h/w buffer policies</span>
4600054             <span class="comment">// Optional M_GEOMETRY chunk</span>
4700055             <a class="code" href="namespaceOgre.html#a662a326">M_SUBMESH</a>             = 0x4000,
4800056                 <span class="comment">// char* materialName</span>
4900057                 <span class="comment">// bool useSharedVertices</span>
5000058                 <span class="comment">// unsigned int indexCount</span>
5100059                 <span class="comment">// bool indexes32Bit</span>
5200060                 <span class="comment">// unsigned int* faceVertexIndices (indexCount)</span>
5300061                 <span class="comment">// OR</span>
5400062                 <span class="comment">// unsigned short* faceVertexIndices (indexCount)</span>
5500063                 <span class="comment">// M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)</span>
5600064                 <a class="code" href="namespaceOgre.html#a662a327">M_SUBMESH_OPERATION</a> = 0x4010, <span class="comment">// optional, trilist assumed if missing</span>
5700065                     <span class="comment">// unsigned short operationType</span>
5800066                 <a class="code" href="namespaceOgre.html#a662a328">M_SUBMESH_BONE_ASSIGNMENT</a> = 0x4100,
5900067                     <span class="comment">// Optional bone weights (repeating section)</span>
6000068                     <span class="comment">// unsigned int vertexIndex;</span>
6100069                     <span class="comment">// unsigned short boneIndex;</span>
6200070                     <span class="comment">// float weight;</span>
6300071             <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>
6400072                 <span class="comment">// unsigned int vertexCount</span>
6500073                 <a class="code" href="namespaceOgre.html#a662a330">M_GEOMETRY_VERTEX_DECLARATION</a> = 0x5100,
6600074                     <a class="code" href="namespaceOgre.html#a662a331">M_GEOMETRY_VERTEX_ELEMENT</a> = 0x5110, <span class="comment">// Repeating section</span>
6700075                         <span class="comment">// unsigned short source;   // buffer bind source</span>
6800076                         <span class="comment">// unsigned short type;     // VertexElementType</span>
6900077                         <span class="comment">// unsigned short semantic; // VertexElementSemantic</span>
7000078                         <span class="comment">// unsigned short offset;   // start offset in buffer in bytes</span>
7100079                         <span class="comment">// unsigned short index;    // index of the semantic (for colours and texture coords)</span>
7200080                 <a class="code" href="namespaceOgre.html#a662a332">M_GEOMETRY_VERTEX_BUFFER</a> = 0x5200, <span class="comment">// Repeating section</span>
7300081                     <span class="comment">// unsigned short bindIndex;    // Index to bind this buffer to</span>
7400082                     <span class="comment">// unsigned short vertexSize;   // Per-vertex size, must agree with declaration at this index</span>
7500083                     <a class="code" href="namespaceOgre.html#a662a333">M_GEOMETRY_VERTEX_BUFFER_DATA</a> = 0x5210,
7600084                         <span class="comment">// raw buffer data</span>
7700085             <a class="code" href="namespaceOgre.html#a662a334">M_MESH_SKELETON_LINK</a> = 0x6000,
7800086                 <span class="comment">// Optional link to skeleton</span>
7900087                 <span class="comment">// char* skeletonName           : name of .skeleton to use</span>
8000088             <a class="code" href="namespaceOgre.html#a662a335">M_MESH_BONE_ASSIGNMENT</a> = 0x7000,
8100089                 <span class="comment">// Optional bone weights (repeating section)</span>
8200090                 <span class="comment">// unsigned int vertexIndex;</span>
8300091                 <span class="comment">// unsigned short boneIndex;</span>
8400092                 <span class="comment">// float weight;</span>
8500093             <a class="code" href="namespaceOgre.html#a662a336">M_MESH_LOD</a> = 0x8000,
8600094                 <span class="comment">// Optional LOD information</span>
8700095                 <span class="comment">// unsigned short numLevels;</span>
8800096                 <span class="comment">// bool manual;  (true for manual alternate meshes, false for generated)</span>
8900097                 <a class="code" href="namespaceOgre.html#a662a337">M_MESH_LOD_USAGE</a> = 0x8100,
9000098                 <span class="comment">// Repeating section, ordered in increasing depth</span>
9100099                 <span class="comment">// NB LOD 0 (full detail from 0 depth) is omitted</span>
9200100                 <span class="comment">// float fromSquaredDepth;</span>
9300101                     <a class="code" href="namespaceOgre.html#a662a338">M_MESH_LOD_MANUAL</a> = 0x8110,
9400102                     <span class="comment">// Required if M_MESH_LOD section manual = true</span>
9500103                     <span class="comment">// String manualMeshName;</span>
9600104                     <a class="code" href="namespaceOgre.html#a662a339">M_MESH_LOD_GENERATED</a> = 0x8120,
9700105                     <span class="comment">// Required if M_MESH_LOD section manual = false</span>
9800106                     <span class="comment">// Repeating section (1 per submesh)</span>
9900107                     <span class="comment">// unsigned int indexCount;</span>
10000108                     <span class="comment">// bool indexes32Bit</span>
10100109                     <span class="comment">// unsigned short* faceIndexes;  (indexCount)</span>
10200110                     <span class="comment">// OR</span>
10300111                     <span class="comment">// unsigned int* faceIndexes;  (indexCount)</span>
10400112             <a class="code" href="namespaceOgre.html#a662a340">M_MESH_BOUNDS</a> = 0x9000,
10500113                 <span class="comment">// float minx, miny, minz</span>
10600114                 <span class="comment">// float maxx, maxy, maxz</span>
10700115                 <span class="comment">// float radius</span>
10800116                     
10900117             <span class="comment">// Added By DrEvil</span>
11000118             <span class="comment">// optional chunk that contains a table of submesh indexes and the names of</span>
11100119             <span class="comment">// the sub-meshes.</span>
11200120             <a class="code" href="namespaceOgre.html#a662a341">M_SUBMESH_NAME_TABLE</a> = 0xA000,
11300121                 <span class="comment">// Subchunks of the name table. Each chunk contains an index &amp; string</span>
11400122                 <a class="code" href="namespaceOgre.html#a662a342">M_SUBMESH_NAME_TABLE_ELEMENT</a> = 0xA100,
11500123                     <span class="comment">// short index</span>
11600124                     <span class="comment">// char* name</span>
11700125             
11800126             <span class="comment">// Optional chunk which stores precomputed edge data                     </span>
11900127             <a class="code" href="namespaceOgre.html#a662a343">M_EDGE_LISTS</a> = 0xB000,
12000128                 <span class="comment">// Each LOD has a separate edge list</span>
12100129                 <a class="code" href="namespaceOgre.html#a662a344">M_EDGE_LIST_LOD</a> = 0xB100,
12200130                     <span class="comment">// unsigned short lodIndex</span>
12300131                     <span class="comment">// bool isManual            // If manual, no edge data here, loaded from manual mesh</span>
12400132                         <span class="comment">// unsigned long numTriangles</span>
12500133                         <span class="comment">// unsigned long numEdgeGroups</span>
12600134                         <span class="comment">// Triangle* triangleList</span>
12700135                             <span class="comment">// unsigned long indexSet</span>
12800136                             <span class="comment">// unsigned long vertexSet</span>
12900137                             <span class="comment">// unsigned long vertIndex[3]</span>
13000138                             <span class="comment">// unsigned long sharedVertIndex[3] </span>
13100139                             <span class="comment">// float normal[4] </span>
13200140
13300141                         <a class="code" href="namespaceOgre.html#a662a345">M_EDGE_GROUP</a> = 0xB110,
13400142                             <span class="comment">// unsigned long vertexSet</span>
13500143                             <span class="comment">// unsigned long numEdges</span>
13600144                             <span class="comment">// Edge* edgeList</span>
13700145                                 <span class="comment">// unsigned long  triIndex[2]</span>
13800146                                 <span class="comment">// unsigned long  vertIndex[2]</span>
13900147                                 <span class="comment">// unsigned long  sharedVertIndex[2]</span>
14000148                                 <span class="comment">// bool degenerate</span>
14100149                     
14200150     
14300151     <span class="comment">/* Version 1.2 of the .mesh fornmat (deprecated)</span>
14400152 <span class="comment">    enum MeshChunkID {</span>
14500153 <span class="comment">        M_HEADER                = 0x1000,</span>
14600154 <span class="comment">            // char*          version           : Version number check</span>
14700155 <span class="comment">        M_MESH                = 0x3000,</span>
14800156 <span class="comment">            // bool skeletallyAnimated   // important flag which affects h/w buffer policies</span>
14900157 <span class="comment">            // Optional M_GEOMETRY chunk</span>
15000158 <span class="comment">            M_SUBMESH             = 0x4000, </span>
15100159 <span class="comment">                // char* materialName</span>
15200160 <span class="comment">                // bool useSharedVertices</span>
15300161 <span class="comment">                // unsigned int indexCount</span>
15400162 <span class="comment">                // bool indexes32Bit</span>
15500163 <span class="comment">                // unsigned int* faceVertexIndices (indexCount)</span>
15600164 <span class="comment">                // OR</span>
15700165 <span class="comment">                // unsigned short* faceVertexIndices (indexCount)</span>
15800166 <span class="comment">                // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)</span>
15900167 <span class="comment">                M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing</span>
16000168 <span class="comment">                    // unsigned short operationType</span>
16100169 <span class="comment">                M_SUBMESH_BONE_ASSIGNMENT = 0x4100,</span>
16200170 <span class="comment">                    // Optional bone weights (repeating section)</span>
16300171 <span class="comment">                    // unsigned int vertexIndex;</span>
16400172 <span class="comment">                    // unsigned short boneIndex;</span>
16500173 <span class="comment">                    // float weight;</span>
16600174 <span class="comment">            M_GEOMETRY          = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH</span>
16700175 <span class="comment">            */</span>
16800176                 <span class="comment">// unsigned int vertexCount</span>
16900177                 <span class="comment">// float* pVertices (x, y, z order x numVertices)</span>
17000178                 <a class="code" href="namespaceOgre.html#a662a346">M_GEOMETRY_NORMALS</a> = 0x5100,    <span class="comment">//(Optional)</span>
17100179                     <span class="comment">// float* pNormals (x, y, z order x numVertices)</span>
17200180                 <a class="code" href="namespaceOgre.html#a662a347">M_GEOMETRY_COLOURS</a> = 0x5200,    <span class="comment">//(Optional)</span>
17300181                     <span class="comment">// unsigned long* pColours (RGBA 8888 format x numVertices)</span>
17400182                 <a class="code" href="namespaceOgre.html#a662a348">M_GEOMETRY_TEXCOORDS</a> = 0x5300,    <span class="comment">//(Optional, REPEATABLE, each one adds an extra set)</span>
17500183                     <span class="comment">// unsigned short dimensions    (1 for 1D, 2 for 2D, 3 for 3D)</span>
17600184                     <span class="comment">// float* pTexCoords  (u [v] [w] order, dimensions x numVertices)</span>
17700185             <span class="comment">/*</span>
17800186 <span class="comment">            M_MESH_SKELETON_LINK = 0x6000,</span>
17900187 <span class="comment">                // Optional link to skeleton</span>
18000188 <span class="comment">                // char* skeletonName           : name of .skeleton to use</span>
18100189 <span class="comment">            M_MESH_BONE_ASSIGNMENT = 0x7000,</span>
18200190 <span class="comment">                // Optional bone weights (repeating section)</span>
18300191 <span class="comment">                // unsigned int vertexIndex;</span>
18400192 <span class="comment">                // unsigned short boneIndex;</span>
18500193 <span class="comment">                // float weight;</span>
18600194 <span class="comment">            M_MESH_LOD = 0x8000,</span>
18700195 <span class="comment">                // Optional LOD information</span>
18800196 <span class="comment">                // unsigned short numLevels;</span>
18900197 <span class="comment">                // bool manual;  (true for manual alternate meshes, false for generated)</span>
19000198 <span class="comment">                M_MESH_LOD_USAGE = 0x8100,</span>
19100199 <span class="comment">                // Repeating section, ordered in increasing depth</span>
19200200 <span class="comment">                // NB LOD 0 (full detail from 0 depth) is omitted</span>
19300201 <span class="comment">                // float fromSquaredDepth;</span>
19400202 <span class="comment">                    M_MESH_LOD_MANUAL = 0x8110,</span>
19500203 <span class="comment">                    // Required if M_MESH_LOD section manual = true</span>
19600204 <span class="comment">                    // String manualMeshName;</span>
19700205 <span class="comment">                    M_MESH_LOD_GENERATED = 0x8120,</span>
19800206 <span class="comment">                    // Required if M_MESH_LOD section manual = false</span>
19900207 <span class="comment">                    // Repeating section (1 per submesh)</span>
20000208 <span class="comment">                    // unsigned int indexCount;</span>
20100209 <span class="comment">                    // bool indexes32Bit</span>
20200210 <span class="comment">                    // unsigned short* faceIndexes;  (indexCount)</span>
20300211 <span class="comment">                    // OR</span>
20400212 <span class="comment">                    // unsigned int* faceIndexes;  (indexCount)</span>
20500213 <span class="comment">            M_MESH_BOUNDS = 0x9000</span>
20600214 <span class="comment">                // float minx, miny, minz</span>
20700215 <span class="comment">                // float maxx, maxy, maxz</span>
20800216 <span class="comment">                // float radius</span>
20900217 <span class="comment"></span>
21000218 <span class="comment">            // Added By DrEvil</span>
21100219 <span class="comment">            // optional chunk that contains a table of submesh indexes and the names of</span>
21200220 <span class="comment">            // the sub-meshes.</span>
21300221 <span class="comment">            M_SUBMESH_NAME_TABLE,</span>
21400222 <span class="comment">                // Subchunks of the name table. Each chunk contains an index &amp; string</span>
21500223 <span class="comment">                M_SUBMESH_NAME_TABLE_ELEMENT,</span>
21600224 <span class="comment">                    // short index</span>
21700225 <span class="comment">                    // char* name</span>
21800226 <span class="comment">    */</span>
21900227     };
22000228 } <span class="comment">// namespace</span>
22100229
22200230
22300231 <span class="preprocessor">#endif</span>
224</pre></div><hr>
225<p>
226Copyright &copy; 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/>
228This 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
236Last modified Sun Feb 12 12:59:48 2006
237</p>
238</body>
239</html>
Note: See TracBrowser for help on using the repository browser.