MDLFileData.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. /*
  2. Open Asset Import Library (ASSIMP)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2008, ASSIMP Development 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 Development 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 MDL file format.
  35. //
  36. // The specification has been taken from various sources on the internet.
  37. // http://tfc.duke.free.fr/coding/mdl-specs-en.html
  38. #ifndef AI_MDLFILEHELPER_H_INC
  39. #define AI_MDLFILEHELPER_H_INC
  40. #include <string>
  41. #include <vector>
  42. #include "../include/aiTypes.h"
  43. #include "../include/aiMesh.h"
  44. #include "../include/aiAnim.h"
  45. #include "../include/aiMaterial.h"
  46. // ugly compiler dependent packing stuff
  47. #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
  48. # pragma pack(push,1)
  49. # define PACK_STRUCT
  50. #elif defined( __GNUC__ )
  51. # define PACK_STRUCT __attribute__((packed))
  52. #else
  53. # error Compiler not supported. Never do this again.
  54. #endif
  55. namespace Assimp
  56. {
  57. namespace MDL
  58. {
  59. // magic bytes used in Quake 1 MDL meshes
  60. #define AI_MDL_MAGIC_NUMBER_BE 'IDPO'
  61. #define AI_MDL_MAGIC_NUMBER_LE 'OPDI'
  62. // magic bytes used in GameStudio A4 MDL meshes
  63. #define AI_MDL_MAGIC_NUMBER_BE_GS4 'MDL3'
  64. #define AI_MDL_MAGIC_NUMBER_LE_GS4 '3LDM'
  65. // magic bytes used in GameStudio A5+ MDL meshes
  66. #define AI_MDL_MAGIC_NUMBER_BE_GS5a 'MDL4'
  67. #define AI_MDL_MAGIC_NUMBER_LE_GS5a '4LDM'
  68. #define AI_MDL_MAGIC_NUMBER_BE_GS5b 'MDL5'
  69. #define AI_MDL_MAGIC_NUMBER_LE_GS5b '5LDM'
  70. // magic bytes used in GameStudio A6+ MDL meshes
  71. #define AI_MDL_MAGIC_NUMBER_BE_GS6 'MDL6'
  72. #define AI_MDL_MAGIC_NUMBER_LE_GS6 '6LDM'
  73. // magic bytes used in GameStudio A7+ MDL meshes
  74. #define AI_MDL_MAGIC_NUMBER_BE_GS7 'MDL7'
  75. #define AI_MDL_MAGIC_NUMBER_LE_GS7 '7LDM'
  76. // magic bytes used in Half Life 2 MDL models
  77. #define AI_MDL_MAGIC_NUMBER_BE_HL2a 'IDST'
  78. #define AI_MDL_MAGIC_NUMBER_LE_HL2a 'TSDI'
  79. #define AI_MDL_MAGIC_NUMBER_BE_HL2b 'IDSQ'
  80. #define AI_MDL_MAGIC_NUMBER_LE_HL2b 'QSDI'
  81. // common limitations for Quake1 meshes. The loader does not check them,
  82. // but models should not exceed these limits.
  83. #if (!defined AI_MDL_VERSION)
  84. # define AI_MDL_VERSION 6
  85. #endif
  86. #if (!defined AI_MDL_MAX_FRAMES)
  87. # define AI_MDL_MAX_FRAMES 256
  88. #endif
  89. #if (!defined AI_MDL_MAX_UVS)
  90. # define AI_MDL_MAX_UVS 1024
  91. #endif
  92. #if (!defined AI_MDL_MAX_VERTS)
  93. # define AI_MDL_MAX_VERTS 1024
  94. #endif
  95. #if (!defined AI_MDL_MAX_TRIANGLES)
  96. # define AI_MDL_MAX_TRIANGLES 2048
  97. #endif
  98. // ---------------------------------------------------------------------------
  99. /** \struct Header
  100. * \brief Data structure for the MDL main header
  101. */
  102. // ---------------------------------------------------------------------------
  103. struct Header
  104. {
  105. //! magic number: "IDPO"
  106. int32_t ident;
  107. //! version number: 6
  108. int32_t version;
  109. //! scale factors for each axis
  110. aiVector3D scale;
  111. //! translation factors for each axis
  112. aiVector3D translate;
  113. //! bounding radius of the mesh
  114. float boundingradius;
  115. //! Position of the viewer's exe. Ignored
  116. aiVector3D vEyePos;
  117. //! Number of textures
  118. int32_t num_skins;
  119. //! Texture width in pixels
  120. int32_t skinwidth;
  121. //! Texture height in pixels
  122. int32_t skinheight;
  123. //! Number of vertices contained in the file
  124. int32_t num_verts;
  125. //! Number of triangles contained in the file
  126. int32_t num_tris;
  127. //! Number of frames contained in the file
  128. int32_t num_frames;
  129. //! 0 = synchron, 1 = random . Ignored
  130. int32_t synctype;
  131. //! State flag
  132. int32_t flags;
  133. //! ???
  134. float size;
  135. } PACK_STRUCT;
  136. // ---------------------------------------------------------------------------
  137. /** \struct Header_MDL7
  138. * \brief Data structure for the MDL 7 main header
  139. */
  140. // ---------------------------------------------------------------------------
  141. struct Header_MDL7
  142. {
  143. //! magic number: "MDL7"
  144. char ident[4];
  145. //! Version number. Ignored
  146. int32_t version;
  147. //! Number of bones in file
  148. int32_t bones_num;
  149. //! Number of groups in file
  150. int32_t groups_num;
  151. //! Size of data in the file
  152. int32_t data_size;
  153. //! Ignored. Used to store entity specific information
  154. int32_t entlump_size;
  155. //! Ignored. Used to store MED related data
  156. int32_t medlump_size;
  157. // -------------------------------------------------------
  158. // Sizes of some file parts
  159. uint16_t bone_stc_size;
  160. uint16_t skin_stc_size;
  161. uint16_t colorvalue_stc_size;
  162. uint16_t material_stc_size;
  163. uint16_t skinpoint_stc_size;
  164. uint16_t triangle_stc_size;
  165. uint16_t mainvertex_stc_size;
  166. uint16_t framevertex_stc_size;
  167. uint16_t bonetrans_stc_size;
  168. uint16_t frame_stc_size;
  169. } PACK_STRUCT;
  170. // ---------------------------------------------------------------------------
  171. /** \struct Header_HL2
  172. * \brief Data structure for the HL2 main header
  173. */
  174. // ---------------------------------------------------------------------------
  175. struct Header_HL2
  176. {
  177. //! magic number: "IDST"/"IDSQ"
  178. char ident[4];
  179. //! Version number
  180. int32_t version;
  181. //! Original file name in pak ?
  182. char name[64];
  183. //! Length of file name/length of file?
  184. int32_t length;
  185. //! For viewer, ignored
  186. aiVector3D eyeposition;
  187. aiVector3D min;
  188. aiVector3D max;
  189. //! AABB of the model
  190. aiVector3D bbmin;
  191. aiVector3D bbmax;
  192. // File flags
  193. int32_t flags;
  194. //! NUmber of bones contained in the file
  195. int32_t numbones;
  196. int32_t boneindex;
  197. //! Number of bone controllers for bone animation
  198. int32_t numbonecontrollers;
  199. int32_t bonecontrollerindex;
  200. //! More bounding boxes ...
  201. int32_t numhitboxes;
  202. int32_t hitboxindex;
  203. //! Animation sequences in the file
  204. int32_t numseq;
  205. int32_t seqindex;
  206. //! Loaded sequences. Ignored
  207. int32_t numseqgroups;
  208. int32_t seqgroupindex;
  209. //! Raw texture data
  210. int32_t numtextures;
  211. int32_t textureindex;
  212. int32_t texturedataindex;
  213. //! Number of skins (=textures?)
  214. int32_t numskinref;
  215. int32_t numskinfamilies;
  216. int32_t skinindex;
  217. //! Number of parts
  218. int32_t numbodyparts;
  219. int32_t bodypartindex;
  220. //! attachable points for gameplay and physics
  221. int32_t numattachments;
  222. int32_t attachmentindex;
  223. //! Table of sound effects associated with the model
  224. int32_t soundtable;
  225. int32_t soundindex;
  226. int32_t soundgroups;
  227. int32_t soundgroupindex;
  228. //! Number of animation transitions
  229. int32_t numtransitions;
  230. int32_t transitionindex;
  231. } PACK_STRUCT;
  232. #define AI_MDL7_MAX_BONENAMESIZE 20
  233. // ---------------------------------------------------------------------------
  234. /** \struct Bone_MDL7
  235. * \brief Bone in a MDL7 file
  236. */
  237. // ---------------------------------------------------------------------------
  238. struct Bone_MDL7
  239. {
  240. uint16_t parent_index;
  241. uint8_t _unused_[2]; //
  242. float x,y,z;
  243. char name[AI_MDL7_MAX_BONENAMESIZE];
  244. };
  245. #define AI_MDL7_MAX_GROUPNAMESIZE 16
  246. // ---------------------------------------------------------------------------
  247. /** \struct Group_MDL7
  248. * \brief Group in a MDL7 file
  249. */
  250. // ---------------------------------------------------------------------------
  251. struct Group_MDL7
  252. {
  253. //! = '1' -> triangle based Mesh
  254. unsigned char typ;
  255. int8_t deformers;
  256. int8_t max_weights;
  257. int8_t _unused_;
  258. //! size of data for this group in bytes ( MD7_GROUP stc. included).
  259. int32_t groupdata_size;
  260. char name[AI_MDL7_MAX_GROUPNAMESIZE];
  261. //! Number of skins
  262. int32_t numskins;
  263. //! Number of texture coordinates
  264. int32_t num_stpts;
  265. //! Number of triangles
  266. int32_t numtris;
  267. //! Number of vertices
  268. int32_t numverts;
  269. //! Number of frames
  270. int32_t numframes;
  271. } PACK_STRUCT;
  272. #define AI_MDL7_SKINTYPE_MIPFLAG 0x08
  273. #define AI_MDL7_SKINTYPE_MATERIAL 0x10
  274. #define AI_MDL7_SKINTYPE_MATERIAL_ASCDEF 0x20
  275. #define AI_MDL7_SKINTYPE_RGBFLAG 0x80
  276. #define AI_MDL7_MAX_BONENAMESIZE 20
  277. // ---------------------------------------------------------------------------
  278. /** \struct Deformer_MDL7
  279. * \brief Deformer in a MDL7 file
  280. */
  281. // ---------------------------------------------------------------------------
  282. struct Deformer_MDL7
  283. {
  284. int8_t deformer_version; // 0
  285. int8_t deformer_typ; // 0 - bones
  286. int8_t _unused_[2];
  287. int32_t group_index;
  288. int32_t elements;
  289. int32_t deformerdata_size;
  290. } PACK_STRUCT;
  291. struct DeformerElement_MDL7
  292. {
  293. //! bei deformer_typ==0 (==bones) element_index == bone index
  294. int32_t element_index;
  295. char element_name[AI_MDL7_MAX_BONENAMESIZE];
  296. int32_t weights;
  297. } PACK_STRUCT;
  298. struct DeformerWeight_MDL7
  299. {
  300. //! for deformer_typ==0 (==bones) index == vertex index
  301. int32_t index;
  302. float weight;
  303. } PACK_STRUCT;
  304. #define AI_MDL7_MAX_TEXNAMESIZE 0x10
  305. typedef int32_t MD7_MATERIAL_ASCDEFSIZE;
  306. // ---------------------------------------------------------------------------
  307. /** \struct Skin_MDL7
  308. * \brief Skin in a MDL7 file
  309. */
  310. // ---------------------------------------------------------------------------
  311. struct Skin_MDL7
  312. {
  313. uint8_t typ;
  314. int8_t _unused_[3];
  315. int32_t width;
  316. int32_t height;
  317. char texture_name[AI_MDL7_MAX_TEXNAMESIZE];
  318. } PACK_STRUCT;
  319. struct ColorValue_MDL7
  320. {
  321. float r,g,b,a;
  322. } PACK_STRUCT;
  323. // ---------------------------------------------------------------------------
  324. /** \struct Material_MDL7
  325. * \brief Material in a MDL7 file
  326. */
  327. // ---------------------------------------------------------------------------
  328. struct Material_MDL7
  329. {
  330. //! Diffuse base color of the material
  331. ColorValue_MDL7 Diffuse;
  332. //! Ambient base color of the material
  333. ColorValue_MDL7 Ambient;
  334. //! Specular base color of the material
  335. ColorValue_MDL7 Specular;
  336. //! Emissive base color of the material
  337. ColorValue_MDL7 Emissive;
  338. //! Phong power
  339. float Power;
  340. } PACK_STRUCT;
  341. // ---------------------------------------------------------------------------
  342. /** \struct Skin
  343. * \brief Skin data structure #1
  344. */
  345. // ---------------------------------------------------------------------------
  346. struct Skin
  347. {
  348. //! 0 = single (Skin), 1 = group (GroupSkin)
  349. //! For MDL3-5: Defines the type of the skin and there
  350. //! fore the size of the data to skip:
  351. //-------------------------------------------------------
  352. //! 2 for 565 RGB,
  353. //! 3 for 4444 ARGB,
  354. //! 10 for 565 mipmapped,
  355. //! 11 for 4444 mipmapped (bpp = 2),
  356. //! 12 for 888 RGB mipmapped (bpp = 3),
  357. //! 13 for 8888 ARGB mipmapped (bpp = 4)
  358. //-------------------------------------------------------
  359. int32_t group;
  360. //! Texture data
  361. uint8_t *data;
  362. } PACK_STRUCT;
  363. struct Skin_MDL5
  364. {
  365. int32_t size, width, height;
  366. uint8_t *data;
  367. } PACK_STRUCT;
  368. struct RGB565
  369. {
  370. uint16_t r : 5;
  371. uint16_t g : 6;
  372. uint16_t b : 5;
  373. } PACK_STRUCT;
  374. struct ARGB4
  375. {
  376. uint16_t a : 4;
  377. uint16_t r : 4;
  378. uint16_t g : 4;
  379. uint16_t b : 4;
  380. } PACK_STRUCT;
  381. // ---------------------------------------------------------------------------
  382. /** \struct GroupSkin
  383. * \brief Skin data structure #2 (group of pictures)
  384. */
  385. // ---------------------------------------------------------------------------
  386. struct GroupSkin
  387. {
  388. //! 0 = single (Skin), 1 = group (GroupSkin)
  389. int32_t group;
  390. //! Number of images
  391. int32_t nb;
  392. //! Time for each image
  393. float *time;
  394. //! Data of each image
  395. uint8_t **data;
  396. } PACK_STRUCT;
  397. // ---------------------------------------------------------------------------
  398. /** \struct TexCoord
  399. * \brief Texture coordinate data structure
  400. */
  401. // ---------------------------------------------------------------------------
  402. struct TexCoord
  403. {
  404. //! Is the vertex on the noundary between front and back piece?
  405. int32_t onseam;
  406. //! Texture coordinate in the tx direction
  407. int32_t s;
  408. //! Texture coordinate in the ty direction
  409. int32_t t;
  410. } PACK_STRUCT;
  411. struct TexCoord_MDL3
  412. {
  413. //! position, horizontally in range 0..skinwidth-1
  414. int16_t u;
  415. //! position, vertically in range 0..skinheight-1
  416. int16_t v;
  417. } PACK_STRUCT;
  418. struct TexCoord_MDL7
  419. {
  420. //! position, horizontally in range 0..1
  421. float u;
  422. //! position, vertically in range 0..1
  423. float v;
  424. } PACK_STRUCT;
  425. // ---------------------------------------------------------------------------
  426. /** \struct Triangle
  427. * \brief Triangle data structure
  428. */
  429. // ---------------------------------------------------------------------------
  430. struct Triangle
  431. {
  432. //! 0 = backface, 1 = frontface
  433. int32_t facesfront;
  434. //! Vertex indices
  435. int32_t vertex[3];
  436. } PACK_STRUCT;
  437. struct Triangle_MDL3
  438. {
  439. //! Index of 3 3D vertices in range 0..numverts
  440. uint16_t index_xyz[3];
  441. //! Index of 3 skin vertices in range 0..numskinverts
  442. uint16_t index_uv[3];
  443. } PACK_STRUCT;
  444. struct SkinSet_MDL7
  445. {
  446. //! Index into the UV coordinate list
  447. uint16_t st_index[3]; // size 6
  448. //! Material index
  449. int32_t material; // size 4
  450. } PACK_STRUCT;
  451. struct Triangle_MDL7
  452. {
  453. //! Vertex indices
  454. uint16_t v_index[3]; // size 6
  455. //! Two skinsets. The second will be used for multi-texturing
  456. SkinSet_MDL7 skinsets[2];
  457. } PACK_STRUCT;
  458. // Helper constants for Triangle::facesfront
  459. #if (!defined AI_MDL_BACKFACE)
  460. # define AI_MDL_BACKFACE 0x0
  461. #endif
  462. #if (!defined AI_MDL_FRONTFACE)
  463. # define AI_MDL_FRONTFACE 0x1
  464. #endif
  465. // ---------------------------------------------------------------------------
  466. /** \struct Vertex
  467. * \brief Vertex data structure
  468. */
  469. // ---------------------------------------------------------------------------
  470. struct Vertex
  471. {
  472. uint8_t v[3];
  473. uint8_t normalIndex;
  474. } PACK_STRUCT;
  475. struct Vertex_MDL4
  476. {
  477. uint16_t v[3];
  478. uint8_t normalIndex;
  479. uint8_t unused;
  480. } PACK_STRUCT;
  481. #define AI_MDL7_FRAMEVERTEX120503_STCSIZE 16
  482. #define AI_MDL7_FRAMEVERTEX030305_STCSIZE 26
  483. // ---------------------------------------------------------------------------
  484. /** \struct Vertex_MDL7
  485. * \brief Vertex data structure used in MDL7 files
  486. */
  487. // ---------------------------------------------------------------------------
  488. struct Vertex_MDL7
  489. {
  490. float x,y,z;
  491. uint16_t vertindex;
  492. union {
  493. uint16_t norm162index;
  494. float norm[3];
  495. };
  496. } PACK_STRUCT;
  497. // ---------------------------------------------------------------------------
  498. /** \struct BoneTransform_MDL7
  499. * \brief bone transformation matrix structure used in MDL7 files
  500. */
  501. // ---------------------------------------------------------------------------
  502. struct BoneTransform_MDL7
  503. {
  504. //! 4*3
  505. float m [4*4];
  506. //! the index of this vertex, 0.. header::bones_num - 1
  507. uint16_t bone_index;
  508. //! I HATE 3DGS AND THE SILLY DEVELOPER WHO DESIGNED
  509. //! THIS STUPID FILE FORMAT!
  510. int8_t _unused_[2];
  511. } PACK_STRUCT;
  512. #define AI_MDL7_MAX_FRAMENAMESIZE 16
  513. // ---------------------------------------------------------------------------
  514. /** \struct Frame_MDL7
  515. * \brief Frame data structure used by MDL7 files
  516. */
  517. // ---------------------------------------------------------------------------
  518. struct Frame_MDL7
  519. {
  520. char frame_name[AI_MDL7_MAX_FRAMENAMESIZE];
  521. uint32_t vertices_count;
  522. uint32_t transmatrix_count;
  523. };
  524. // ---------------------------------------------------------------------------
  525. /** \struct SimpleFrame
  526. * \brief Data structure for a simple frame
  527. */
  528. // ---------------------------------------------------------------------------
  529. struct SimpleFrame
  530. {
  531. //! Minimum vertex of the bounding box
  532. Vertex bboxmin;
  533. //! Maximum vertex of the bounding box
  534. Vertex bboxmax;
  535. //! Name of the frame
  536. char name[16];
  537. //! Vertex list of the frame
  538. Vertex *verts;
  539. } PACK_STRUCT;
  540. // ---------------------------------------------------------------------------
  541. /** \struct Frame
  542. * \brief Model frame data structure
  543. */
  544. // ---------------------------------------------------------------------------
  545. struct Frame
  546. {
  547. //! 0 = simple frame, !0 = group frame
  548. int32_t type;
  549. //! Frame data
  550. SimpleFrame frame;
  551. } PACK_STRUCT;
  552. struct SimpleFrame_MDLn_SP
  553. {
  554. //! Minimum vertex of the bounding box
  555. Vertex_MDL4 bboxmin;
  556. //! Maximum vertex of the bounding box
  557. Vertex_MDL4 bboxmax;
  558. //! Name of the frame
  559. char name[16];
  560. //! Vertex list of the frame
  561. Vertex_MDL4 *verts;
  562. } PACK_STRUCT;
  563. // ---------------------------------------------------------------------------
  564. /** \struct GroupFrame
  565. * \brief Data structure for a group of frames
  566. */
  567. // ---------------------------------------------------------------------------
  568. struct GroupFrame
  569. {
  570. //! 0 = simple frame, !0 = group frame
  571. int32_t type;
  572. //! Minimum vertex for all single frames
  573. Vertex min;
  574. //! Maximum vertex for all single frames
  575. Vertex max;
  576. //! Time for all single frames
  577. float *time;
  578. //! List of single frames
  579. SimpleFrame *frames;
  580. } PACK_STRUCT;
  581. // reset packing to the original value
  582. #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
  583. # pragma pack( pop )
  584. #endif
  585. #undef PACK_STRUCT
  586. // ---------------------------------------------------------------------------
  587. /** \struct IntFace_MDL7
  588. * \brief Internal data structure to temporarily represent a face
  589. */
  590. // ---------------------------------------------------------------------------
  591. struct IntFace_MDL7
  592. {
  593. // provide a constructor for our own convenience
  594. IntFace_MDL7()
  595. {
  596. // set everything to zero
  597. mIndices[0] = mIndices[1] = mIndices[2] = 0;
  598. iMatIndex[0] = iMatIndex[1] = 0;
  599. }
  600. //! Vertex indices
  601. uint32_t mIndices[3];
  602. //! Material index (maximally two channels, which are joined later)
  603. unsigned int iMatIndex[2];
  604. };
  605. // ---------------------------------------------------------------------------
  606. /** \struct IntMaterial_MDL7
  607. * \brief Internal data structure to temporarily represent a material
  608. * which has been created from two single materials along with the
  609. * original material indices.
  610. */
  611. // ---------------------------------------------------------------------------
  612. struct IntMaterial_MDL7
  613. {
  614. // provide a constructor for our own convenience
  615. IntMaterial_MDL7()
  616. {
  617. pcMat = NULL;
  618. iOldMatIndices[0] = iOldMatIndices[1] = 0;
  619. }
  620. //! Material instance
  621. MaterialHelper* pcMat;
  622. //! Old material indices
  623. unsigned int iOldMatIndices[2];
  624. };
  625. };}; // end namespaces
  626. #endif // !! AI_MDLFILEHELPER_H_INC