2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ==============================================================================
31 Alias models are position independent, so the cache manager can move them.
32 ==============================================================================
37 typedef struct daliashdr_s
58 ========================================================================
60 .MD2 triangle model file format
62 ========================================================================
65 // LadyHavoc: grabbed this from the Q2 utility source,
66 // renamed a things to avoid conflicts
68 #define MD2ALIAS_VERSION 8
69 #define MD2_SKINNAME 64
71 typedef struct md2stvert_s
77 typedef struct md2triangle_s
83 typedef struct md2frame_s
85 float scale[3]; // multiply byte verts by this
86 float translate[3]; // then add this
87 char name[16]; // frame name from grabbing
91 // a positive integer starts a tristrip command, followed by that many
93 // a negative integer starts a trifan command, followed by -x vertexes
94 // a zero indicates the end of the command list.
95 // a vertex consists of a floating point s, a floating point t,
96 // and an integer vertex index.
106 int framesize; // byte size of each frame
110 int num_st; // greater than num_xyz for seams
112 int num_glcmds; // dwords in strip/fan command list
115 int ofs_skins; // each skin is a MAX_SKINNAME string
116 int ofs_st; // byte offset from start for stverts
117 int ofs_tris; // offset for dtriangles
118 int ofs_frames; // offset for first frame
120 int ofs_end; // end of file
123 // all md3 ints, floats, and shorts, are little endian, and thus need to be
124 // passed through LittleLong/LittleFloat/LittleShort to avoid breaking on
125 // bigendian machines
126 #define MD3VERSION 15
128 #define MD3FRAMENAME 16
130 // the origin is at 1/64th scale
131 // the pitch and yaw are encoded as 8 bits each
132 typedef struct md3vertex_s
141 typedef struct md3frameinfo_s
147 char name[MD3FRAMENAME];
151 // one per tag per frame
152 typedef struct md3tag_s
156 float rotationmatrix[9];
160 // one per shader per mesh
161 typedef struct md3shader_s
164 // engine field (yes this empty int does exist in the file)
169 // one per mesh per model
171 // note that the lump_ offsets in this struct are relative to the beginning
172 // of the mesh struct
174 // to find the next mesh in the file, you must go to lump_end, which puts you
175 // at the beginning of the next mesh
176 typedef struct md3mesh_s
178 char identifier[4]; // "IDP3"
188 int lump_framevertices;
193 // this struct is at the beginning of the md3 file
195 // note that the lump_ offsets in this struct are relative to the beginning
196 // of the header struct (which is the beginning of the file)
197 typedef struct md3modelheader_s
199 char identifier[4]; // "IDP3"
214 typedef struct aliastag_s
221 typedef struct aliasbone_s
225 int parent; // -1 for no parent
229 #include "model_zymotic.h"
231 #include "model_dpmodel.h"
233 #include "model_psk.h"
235 #include "model_iqm.h"
237 // for decoding md3 model latlong vertex normals
238 extern float mod_md3_sin[320];
240 extern struct cvar_s r_skeletal_debugbone;
241 extern struct cvar_s r_skeletal_debugbonecomponent;
242 extern struct cvar_s r_skeletal_debugbonevalue;
243 extern struct cvar_s r_skeletal_debugtranslatex;
244 extern struct cvar_s r_skeletal_debugtranslatey;
245 extern struct cvar_s r_skeletal_debugtranslatez;
251 void *Mod_Skeletal_AnimateVertices_AllocBuffers(size_t nbytes);
252 void Mod_Skeletal_BuildTransforms(const struct model_s * RESTRICT model, const struct frameblend_s * RESTRICT frameblend, const struct skeleton_s *skeleton, float * RESTRICT bonepose, float * RESTRICT boneposerelative);