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