vrshoot

view libs/assimp/HMPFileData.h @ 2:334d17aed7de

visual studio project files
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 18:36:38 +0200
parents
children
line source
1 /*
2 Open Asset Import Library (assimp)
3 ----------------------------------------------------------------------
5 Copyright (c) 2006-2012, assimp team
6 All rights reserved.
8 Redistribution and use of this software in source and binary forms,
9 with or without modification, are permitted provided that the
10 following conditions are met:
12 * Redistributions of source code must retain the above
13 copyright notice, this list of conditions and the
14 following disclaimer.
16 * Redistributions in binary form must reproduce the above
17 copyright notice, this list of conditions and the
18 following disclaimer in the documentation and/or other
19 materials provided with the distribution.
21 * Neither the name of the assimp team, nor the names of its
22 contributors may be used to endorse or promote products
23 derived from this software without specific prior
24 written permission of the assimp team.
26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 ----------------------------------------------------------------------
39 */
40 //!
41 //! @file Data structures for the 3D Game Studio Heightmap format (HMP)
42 //!
44 namespace Assimp {
45 namespace HMP {
47 #include "assimp/Compiler/pushpack1.h"
49 // to make it easier for us, we test the magic word against both "endianesses"
50 #define AI_HMP_MAGIC_NUMBER_BE_4 AI_MAKE_MAGIC("HMP4")
51 #define AI_HMP_MAGIC_NUMBER_LE_4 AI_MAKE_MAGIC("4PMH")
53 #define AI_HMP_MAGIC_NUMBER_BE_5 AI_MAKE_MAGIC("HMP5")
54 #define AI_HMP_MAGIC_NUMBER_LE_5 AI_MAKE_MAGIC("5PMH")
56 #define AI_HMP_MAGIC_NUMBER_BE_7 AI_MAKE_MAGIC("HMP7")
57 #define AI_HMP_MAGIC_NUMBER_LE_7 AI_MAKE_MAGIC("7PMH")
59 // ---------------------------------------------------------------------------
60 /** Data structure for the header of a HMP5 file.
61 * This is also used by HMP4 and HMP7, but with modifications
62 */
63 struct Header_HMP5
64 {
65 int8_t ident[4]; // "HMP5"
66 int32_t version;
68 // ignored
69 float scale[3];
70 float scale_origin[3];
71 float boundingradius;
73 //! Size of one triangle in x direction
74 float ftrisize_x;
75 //! Size of one triangle in y direction
76 float ftrisize_y;
77 //! Number of vertices in x direction
78 float fnumverts_x;
80 //! Number of skins in the file
81 int32_t numskins;
83 // can ignore this?
84 int32_t skinwidth;
85 int32_t skinheight;
87 //!Number of vertices in the file
88 int32_t numverts;
90 // ignored and zero
91 int32_t numtris;
93 //! only one supported ...
94 int32_t numframes;
96 //! Always 0 ...
97 int32_t num_stverts;
98 int32_t flags;
99 float size;
100 } PACK_STRUCT;
102 // ---------------------------------------------------------------------------
103 /** Data structure for a terrain vertex in a HMP4 file
104 */
105 struct Vertex_HMP4
106 {
107 uint16_t p_pos[3];
108 uint8_t normals162index;
109 uint8_t pad;
110 } PACK_STRUCT;
112 // ---------------------------------------------------------------------------
113 /** Data structure for a terrain vertex in a HMP5 file
114 */
115 struct Vertex_HMP5
116 {
117 uint16_t z;
118 uint8_t normals162index;
119 uint8_t pad;
120 } PACK_STRUCT;
122 // ---------------------------------------------------------------------------
123 /** Data structure for a terrain vertex in a HMP7 file
124 */
125 struct Vertex_HMP7
126 {
127 uint16_t z;
128 int8_t normal_x,normal_y;
129 } PACK_STRUCT;
131 #include "assimp/Compiler/poppack1.h"
133 } //! namespace HMP
134 } //! namespace Assimp