vrshoot

view libs/assimp/HalfLifeFileData.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line source
1 /*
2 Open Asset Import Library (assimp)
3 ----------------------------------------------------------------------
5 Copyright (c) 2006-2012, assimp team
6 All rights reserved.
8 Redistribution and use of this software in source and binary forms,
9 with or without modification, are permitted provided that the
10 following conditions are met:
12 * Redistributions of source code must retain the above
13 copyright notice, this list of conditions and the
14 following disclaimer.
16 * Redistributions in binary form must reproduce the above
17 copyright notice, this list of conditions and the
18 following disclaimer in the documentation and/or other
19 materials provided with the distribution.
21 * Neither the name of the assimp team, nor the names of its
22 contributors may be used to endorse or promote products
23 derived from this software without specific prior
24 written permission of the assimp team.
26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 ----------------------------------------------------------------------
39 */
42 //
43 //! @file Definition of in-memory structures for the HL2 MDL file format
44 // and for the HalfLife text format (SMD)
45 //
46 // The specification has been taken from various sources on the internet.
49 #ifndef AI_MDLFILEHELPER2_H_INC
50 #define AI_MDLFILEHELPER2_H_INC
52 #include "assimp/Compiler/pushpack1.h"
54 #include "MDLFileData.h"
56 namespace Assimp {
57 namespace MDL {
59 // magic bytes used in Half Life 2 MDL models
60 #define AI_MDL_MAGIC_NUMBER_BE_HL2a AI_MAKE_MAGIC("IDST")
61 #define AI_MDL_MAGIC_NUMBER_LE_HL2a AI_MAKE_MAGIC("TSDI")
62 #define AI_MDL_MAGIC_NUMBER_BE_HL2b AI_MAKE_MAGIC("IDSQ")
63 #define AI_MDL_MAGIC_NUMBER_LE_HL2b AI_MAKE_MAGIC("QSDI")
65 // ---------------------------------------------------------------------------
66 /** \struct Header_HL2
67 * \brief Data structure for the HL2 main header
68 */
69 // ---------------------------------------------------------------------------
70 struct Header_HL2
71 {
72 //! magic number: "IDST"/"IDSQ"
73 char ident[4];
75 //! Version number
76 int32_t version;
78 //! Original file name in pak ?
79 char name[64];
81 //! Length of file name/length of file?
82 int32_t length;
84 //! For viewer, ignored
85 aiVector3D eyeposition;
86 aiVector3D min;
87 aiVector3D max;
89 //! AABB of the model
90 aiVector3D bbmin;
91 aiVector3D bbmax;
93 // File flags
94 int32_t flags;
96 //! NUmber of bones contained in the file
97 int32_t numbones;
98 int32_t boneindex;
100 //! Number of bone controllers for bone animation
101 int32_t numbonecontrollers;
102 int32_t bonecontrollerindex;
104 //! More bounding boxes ...
105 int32_t numhitboxes;
106 int32_t hitboxindex;
108 //! Animation sequences in the file
109 int32_t numseq;
110 int32_t seqindex;
112 //! Loaded sequences. Ignored
113 int32_t numseqgroups;
114 int32_t seqgroupindex;
116 //! Raw texture data
117 int32_t numtextures;
118 int32_t textureindex;
119 int32_t texturedataindex;
121 //! Number of skins (=textures?)
122 int32_t numskinref;
123 int32_t numskinfamilies;
124 int32_t skinindex;
126 //! Number of parts
127 int32_t numbodyparts;
128 int32_t bodypartindex;
130 //! attachable points for gameplay and physics
131 int32_t numattachments;
132 int32_t attachmentindex;
134 //! Table of sound effects associated with the model
135 int32_t soundtable;
136 int32_t soundindex;
137 int32_t soundgroups;
138 int32_t soundgroupindex;
140 //! Number of animation transitions
141 int32_t numtransitions;
142 int32_t transitionindex;
143 } PACK_STRUCT;
145 #include "assimp/Compiler/poppack1.h"
147 }
148 } // end namespaces
150 #endif // ! AI_MDLFILEHELPER2_H_INC