You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

135 line
3.9 KiB

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