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