UFO: Alien Invasion
Doxygen documentation generating
r_model_alias.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 1997-2001 Id Software, Inc.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 #define MODEL_MAX_PATH 64
29 #define MAX_ALIAS_TRIS 4096
30 #define MAX_ALIAS_VERTS 8192
31 
32 #define mAliasCoord_t vec2_t
33 
34 typedef struct mAliasVertex_s {
38 
39 typedef struct mAliasComplexVertex_s {
44 
45 typedef struct mAliasBoneMatrix_s {
46  vec4_t matrix[3];
48 
49 typedef struct mAliasBoneVertex_s {
51  float influence;
53  unsigned int bonenum;
55 
56 typedef struct mAliasFrame_s {
60  float radius;
63 
67 typedef struct mAliasTagOrientation_s {
71  vec3_t axis[3];
73 
82 typedef struct mAliasTag_s {
87 } mAliasTag_t;
88 
89 typedef struct mAliasSkin_s {
91  int shader;
93 } mAliasSkin_t;
94 
95 typedef struct mIndexList_s {
96  int length;
97  int32_t* list;
98 } mIndexList_t;
99 
100 typedef struct mAliasMesh_s {
101  int32_t num_verts;
105 
106  /* static meshes have vertex arrays */
114 
115  int num_tris;
116  int32_t* indexes;
117  int32_t num_indexes;
119 
122 
127 } mAliasMesh_t;
128 
129 #define MAX_ANIMS 128
130 #define MAX_ANIMNAME 16
131 
132 typedef struct mAliasAnim_s {
134  int from;
135  int to;
136  int time;
137 } mAliasAnim_t;
138 
139 typedef struct mAliasBone_s {
140  char name[MAX_VAR];
141  int flags;
142  int parent; /* -1 for no parent */
143 } mAliasBone_t;
144 
145 typedef struct mAliasModel_s {
148  int curFrame;
149  int oldFrame;
150 
152  int num_tags;
155 
158 
161 
165  int curAnim;
166 } mAliasModel_t;
167 
168 void R_ModLoadAnims(mAliasModel_t* mod, const char* animname);
169 bool R_ModLoadMDX(struct model_s* mod);
170 void R_ModCalcUniqueNormalsAndTangents(mAliasMesh_t* mesh, int nFrames, float smoothness);
171 void R_FillArrayData(mAliasModel_t* mod, mAliasMesh_t* mesh, float backlerp, int framenum, int oldframenum, bool prerender);
172 void R_ModLoadArrayData(mAliasModel_t* mod, mAliasMesh_t* mesh, bool loadNormals);
mAliasAnim_t * animdata
int32_t * list
Definition: r_model_alias.h:97
#define MAX_ANIMNAME
vec_t * next_verts
unsigned int bonenum
Definition: r_model_alias.h:53
float vec_t
Definition: ufotypes.h:37
mAliasCoord_t * stcoords
mIndexList_t * revIndexes
#define mAliasCoord_t
Definition: r_model_alias.h:32
void R_ModLoadArrayData(mAliasModel_t *mod, mAliasMesh_t *mesh, bool loadNormals)
Allocates data arrays for animated models. Only called once at loading time.
int32_t num_indexes
mAliasBone_t * bones
void R_FillArrayData(mAliasModel_t *mod, mAliasMesh_t *mesh, float backlerp, int framenum, int oldframenum, bool prerender)
Converts the model data into the opengl arrays.
vec_t * normals
vec_t * tangents
mAliasTag_t * tags
#define MAX_VAR
Definition: shared.h:36
int32_t * indexes
Definition: aabb.h:42
mAliasBoneMatrix_t * boneMatrix
Definition: r_model_alias.h:61
vec_t * next_tangents
vec_t * next_normals
void R_ModCalcUniqueNormalsAndTangents(mAliasMesh_t *mesh, int nFrames, float smoothness)
Calculates normals and tangents for all frames and does vertex merging based on smoothness.
vec_t * texcoords
#define MODEL_MAX_PATH
Definition: r_model_alias.h:28
image_t * skin
Definition: r_model_alias.h:92
mAliasSkin_t * skins
int32_t num_verts
mAliasBoneVertex_t * bonesVertexes
void R_ModLoadAnims(mAliasModel_t *mod, const char *animname)
mAliasVertex_t * vertexes
mAliasTagOrientation_t * orient
Definition: r_model_alias.h:86
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
vec_t vec3_t[3]
Definition: ufotypes.h:39
mAliasMesh_t * meshes
mAliasFrame_t * frames
vec3_t translate
Definition: r_model_alias.h:58
bool R_ModLoadMDX(struct model_s *mod)
vec_t vec4_t[4]
Definition: ufotypes.h:40