HalfLifeFileData.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2025, 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 Definition of in-memory structures for the HL2 MDL file format
  35. // and for the HalfLife text format (SMD)
  36. //
  37. // The specification has been taken from various sources on the internet.
  38. #ifndef AI_MDLFILEHELPER2_H_INC
  39. #define AI_MDLFILEHELPER2_H_INC
  40. #include <assimp/Compiler/pushpack1.h>
  41. namespace Assimp {
  42. namespace MDL {
  43. // magic bytes used in Half Life 2 MDL models
  44. #define AI_MDL_MAGIC_NUMBER_BE_HL2a AI_MAKE_MAGIC("IDST")
  45. #define AI_MDL_MAGIC_NUMBER_LE_HL2a AI_MAKE_MAGIC("TSDI")
  46. #define AI_MDL_MAGIC_NUMBER_BE_HL2b AI_MAKE_MAGIC("IDSQ")
  47. #define AI_MDL_MAGIC_NUMBER_LE_HL2b AI_MAKE_MAGIC("QSDI")
  48. // ---------------------------------------------------------------------------
  49. /** \struct Header_HL2
  50. * \brief Data structure for the HL2 main header
  51. */
  52. // ---------------------------------------------------------------------------
  53. struct Header_HL2 {
  54. //! magic number: "IDST"/"IDSQ"
  55. char ident[4];
  56. //! Version number
  57. int32_t version;
  58. //! Original file name in pak ?
  59. char name[64];
  60. //! Length of file name/length of file?
  61. int32_t length;
  62. //! For viewer, ignored
  63. aiVector3D eyeposition;
  64. aiVector3D min;
  65. aiVector3D max;
  66. //! AABB of the model
  67. aiVector3D bbmin;
  68. aiVector3D bbmax;
  69. // File flags
  70. int32_t flags;
  71. //! NUmber of bones contained in the file
  72. int32_t numbones;
  73. int32_t boneindex;
  74. //! Number of bone controllers for bone animation
  75. int32_t numbonecontrollers;
  76. int32_t bonecontrollerindex;
  77. //! More bounding boxes ...
  78. int32_t numhitboxes;
  79. int32_t hitboxindex;
  80. //! Animation sequences in the file
  81. int32_t numseq;
  82. int32_t seqindex;
  83. //! Loaded sequences. Ignored
  84. int32_t numseqgroups;
  85. int32_t seqgroupindex;
  86. //! Raw texture data
  87. int32_t numtextures;
  88. int32_t textureindex;
  89. int32_t texturedataindex;
  90. //! Number of skins (=textures?)
  91. int32_t numskinref;
  92. int32_t numskinfamilies;
  93. int32_t skinindex;
  94. //! Number of parts
  95. int32_t numbodyparts;
  96. int32_t bodypartindex;
  97. //! attachable points for gameplay and physics
  98. int32_t numattachments;
  99. int32_t attachmentindex;
  100. //! Table of sound effects associated with the model
  101. int32_t soundtable;
  102. int32_t soundindex;
  103. int32_t soundgroups;
  104. int32_t soundgroupindex;
  105. //! Number of animation transitions
  106. int32_t numtransitions;
  107. int32_t transitionindex;
  108. } /* PACK_STRUCT */;
  109. #include <assimp/Compiler/poppack1.h>
  110. }
  111. } // end namespaces
  112. #endif // ! AI_MDLFILEHELPER2_H_INC