1 | /* |
2 | Open Asset Import Library (assimp) |
3 | ---------------------------------------------------------------------- |
4 | |
5 | Copyright (c) 2006-2017, assimp team |
6 | |
7 | All rights reserved. |
8 | |
9 | Redistribution and use of this software in source and binary forms, |
10 | with or without modification, are permitted provided that the |
11 | following 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 | |
27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
37 | OF 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 | |
45 | namespace Assimp { |
46 | namespace 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 | */ |
65 | struct |
66 | { |
67 | int8_t [4]; // "HMP5" |
68 | int32_t ; |
69 | |
70 | // ignored |
71 | float [3]; |
72 | float [3]; |
73 | float ; |
74 | |
75 | //! Size of one triangle in x direction |
76 | float ; |
77 | //! Size of one triangle in y direction |
78 | float ; |
79 | //! Number of vertices in x direction |
80 | float ; |
81 | |
82 | //! Number of skins in the file |
83 | int32_t ; |
84 | |
85 | // can ignore this? |
86 | int32_t ; |
87 | int32_t ; |
88 | |
89 | //!Number of vertices in the file |
90 | int32_t ; |
91 | |
92 | // ignored and zero |
93 | int32_t ; |
94 | |
95 | //! only one supported ... |
96 | int32_t ; |
97 | |
98 | //! Always 0 ... |
99 | int32_t ; |
100 | int32_t ; |
101 | float ; |
102 | } PACK_STRUCT; |
103 | |
104 | // --------------------------------------------------------------------------- |
105 | /** Data structure for a terrain vertex in a HMP4 file |
106 | */ |
107 | struct 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 | */ |
117 | struct 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 | */ |
127 | struct 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 | |