UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
r_entity.h
Go to the documentation of this file.
1
4
5
/*
6
Copyright (C) 1997-2001 Id Software, Inc.
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17
See the GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23
*/
24
25
#pragma once
26
27
#define MAX_ANIMLIST 8
28
#define MAX_ENTITY_LIGHTS 7
29
30
#include "
r_light.h
"
31
#include "
r_lighting.h
"
32
34
#define RF_NONE 0x00000000
35
#define RF_TRANSLUCENT 0x00000001
36
#define RF_BOX 0x00000002
37
#define RF_PATH 0x01000000
38
#define RF_ARROW 0x02000000
39
41
#define RF_NO_SHADOW 0x00000004
42
#define RF_BLOOD 0x00000008
43
#define RF_SELECTED 0x00000010
44
#define RF_MEMBER 0x00000020
45
#define RF_ALLIED 0x00000040
46
#define RF_ACTOR 0x00000080
47
#define RF_PULSE 0x00000100
48
#define RF_IRGOGGLES 0x00000200
49
#define RF_NEUTRAL 0x00000400
50
#define RF_SHADOW 0x00000800
51
#define RF_OPPONENT 0x00001000
52
#define RF_IRGOGGLESSHOT 0x00002000
53
54
typedef
struct
animState_s
{
55
int
frame
;
56
int
oldframe
;
57
float
backlerp
;
58
int
time
;
59
int
dt
;
60
int
mesh
;
61
62
byte
list
[
MAX_ANIMLIST
];
63
byte
lcur
;
64
byte
ladd
;
65
byte
change
;
66
67
animState_s
() :
68
frame
(0),
69
oldframe
(0),
70
backlerp
(0.0f),
71
time
(0),
72
dt
(0),
73
mesh
(0),
74
lcur
(0),
75
ladd
(0),
76
change
(0)
77
{
78
OBJZERO
(
list
);
79
}
80
}
animState_t
;
81
85
typedef
struct
transform_s
{
86
bool
done
;
87
bool
processing
;
88
float
matrix
[16];
89
90
transform_s
() :
done
(false),
processing
(false)
91
{
92
OBJZERO
(
matrix
);
93
}
94
}
transform_t
;
95
96
typedef
struct
entity_s
{
97
struct
model_s*
model
;
98
vec3_t
angles
;
99
vec3_t
scale
;
100
vec3_t
color
;
101
vec3_t
origin
;
102
vec3_t
oldorigin
;
103
AABB
eBox
;
104
105
/* tag positioning */
106
struct
entity_s
*
tagent
;
107
const
char
*
tagname
;
108
109
/* misc */
110
int
skinnum
;
111
float
alpha
;
112
int
flags
;
113
float
distanceFromViewOrigin
;
114
115
bool
isOriginBrushModel
;
116
117
animState_t
as
;
118
119
transform_t
transform
;
120
121
vec4_t
shell
;
122
123
const
image_t
*
texture
;
124
125
lighting_t
*
lighting
;
126
127
struct
entity_s
*
next
;
128
129
130
inline
entity_s
(
int
flag =
RF_NONE
) :
131
model
(
nullptr
),
132
eBox
(
AABB
()),
133
tagent
(
nullptr
),
134
tagname
(
nullptr
),
135
skinnum
(0),
136
alpha
(0.0f),
137
flags
(flag),
138
distanceFromViewOrigin
(0.0f),
139
isOriginBrushModel
(false),
140
as
(animState_s()),
141
transform
(transform_s()),
142
texture
(
nullptr
),
143
lighting
(
nullptr
),
144
next
(
nullptr
)
145
{
146
VectorClear
(
angles
);
147
VectorClear
(
scale
);
148
VectorClear
(
color
);
149
VectorClear
(
origin
);
150
VectorClear
(
oldorigin
);
151
Vector4Clear
(
shell
);
152
}
153
154
inline
void
setScale
(
const
vec3_t
scale_)
155
{
156
VectorCopy
(scale_,
scale
);
157
}
158
159
inline
vec_t
getScaleX
()
const
160
{
161
return
scale
[0];
162
}
163
}
entity_t
;
164
165
/* entity chains for rendering */
166
extern
entity_t
*
r_opaque_mesh_entities
;
167
extern
entity_t
*
r_blend_mesh_entities
;
168
extern
entity_t
*
r_null_entities
;
169
extern
entity_t
*
r_special_entities
;
170
171
172
int
R_AddEntity
(
const
entity_t
* ent);
173
entity_t
*
R_GetFreeEntity
(
void
);
174
entity_t
*
R_GetEntity
(
int
id
);
175
void
R_EntitySetOrigin
(
entity_t
* ent,
const
vec3_t
origin
);
176
void
R_EntityAddToOrigin
(
entity_t
* ent,
const
vec3_t
offset
);
177
void
R_TransformForEntity
(
const
entity_t
* e,
const
vec3_t
in,
vec3_t
out);
178
179
void
R_DrawEntityEffects
(
void
);
180
void
R_DrawMeshEntities
(
entity_t
* ents);
181
void
R_DrawOpaqueMeshEntities
(
entity_t
* ents);
182
void
R_DrawBlendMeshEntities
(
entity_t
* ents);
183
void
R_DrawSpecialEntities
(
const
entity_t
* ents);
184
void
R_DrawNullEntities
(
const
entity_t
* ents);
AABB
Definition
aabb.h:42
nullptr
#define nullptr
Definition
cxx.h:53
origin
voidpf uLong int origin
Definition
ioapi.h:45
offset
voidpf uLong offset
Definition
ioapi.h:45
r_blend_mesh_entities
entity_t * r_blend_mesh_entities
Definition
r_entity.cpp:38
r_null_entities
entity_t * r_null_entities
Definition
r_entity.cpp:39
r_special_entities
entity_t * r_special_entities
Definition
r_entity.cpp:40
r_opaque_mesh_entities
entity_t * r_opaque_mesh_entities
Definition
r_entity.cpp:37
R_DrawSpecialEntities
void R_DrawSpecialEntities(const entity_t *ents)
Definition
r_entity.cpp:473
R_TransformForEntity
void R_TransformForEntity(const entity_t *e, const vec3_t in, vec3_t out)
Definition
r_entity.cpp:522
R_AddEntity
int R_AddEntity(const entity_t *ent)
Adds a copy of the specified entity to the list of all known render entities.
Definition
r_entity.cpp:706
R_EntityAddToOrigin
void R_EntityAddToOrigin(entity_t *ent, const vec3_t offset)
Translates the origin of the given entity by the given offset vector.
Definition
r_entity.cpp:57
R_DrawOpaqueMeshEntities
void R_DrawOpaqueMeshEntities(entity_t *ents)
Definition
r_entity.cpp:339
R_DrawBlendMeshEntities
void R_DrawBlendMeshEntities(entity_t *ents)
Definition
r_entity.cpp:411
R_GetEntity
entity_t * R_GetEntity(int id)
Returns a specific entity from the list.
Definition
r_entity.cpp:694
R_DrawEntityEffects
void R_DrawEntityEffects(void)
Draws shadow and highlight effects for the entities (actors).
Definition
r_entity.cpp:208
R_GetFreeEntity
entity_t * R_GetFreeEntity(void)
Get the next free entry in the entity list (the last one).
Definition
r_entity.cpp:684
MAX_ANIMLIST
#define MAX_ANIMLIST
Definition
r_entity.h:27
R_EntitySetOrigin
void R_EntitySetOrigin(entity_t *ent, const vec3_t origin)
setter for entity origin
Definition
r_entity.cpp:47
RF_NONE
#define RF_NONE
Definition
r_entity.h:34
R_DrawMeshEntities
void R_DrawMeshEntities(entity_t *ents)
Draws the list of entities.
Definition
r_entity.cpp:316
R_DrawNullEntities
void R_DrawNullEntities(const entity_t *ents)
Draw entities which models couldn't be loaded.
Definition
r_entity.cpp:503
r_light.h
r_lighting.h
OBJZERO
#define OBJZERO(obj)
Definition
shared.h:178
animState_t
Definition
r_entity.h:54
animState_t::animState_s
animState_s()
Definition
r_entity.h:67
animState_t::change
byte change
Definition
r_entity.h:65
animState_t::time
int time
Definition
r_entity.h:58
animState_t::frame
int frame
Definition
r_entity.h:55
animState_t::lcur
byte lcur
Definition
r_entity.h:63
animState_t::mesh
int mesh
Definition
r_entity.h:60
animState_t::list
byte list[MAX_ANIMLIST]
Definition
r_entity.h:62
animState_t::ladd
byte ladd
Definition
r_entity.h:64
animState_t::dt
int dt
Definition
r_entity.h:59
animState_t::backlerp
float backlerp
Definition
r_entity.h:57
animState_t::oldframe
int oldframe
Definition
r_entity.h:56
entity_t
Definition
r_entity.h:96
entity_t::scale
vec3_t scale
Definition
r_entity.h:99
entity_t::alpha
float alpha
Definition
r_entity.h:111
entity_t::flags
int flags
Definition
r_entity.h:112
entity_t::distanceFromViewOrigin
float distanceFromViewOrigin
Definition
r_entity.h:113
entity_t::lighting
lighting_t * lighting
Definition
r_entity.h:125
entity_t::angles
vec3_t angles
Definition
r_entity.h:98
entity_t::model
struct model_s * model
Definition
r_entity.h:97
entity_t::setScale
void setScale(const vec3_t scale_)
Definition
r_entity.h:154
entity_t::getScaleX
vec_t getScaleX() const
Definition
r_entity.h:159
entity_t::shell
vec4_t shell
Definition
r_entity.h:121
entity_t::tagname
const char * tagname
Definition
r_entity.h:107
entity_t::next
struct entity_s * next
Definition
r_entity.h:127
entity_t::origin
vec3_t origin
Definition
r_entity.h:101
entity_t::color
vec3_t color
Definition
r_entity.h:100
entity_t::skinnum
int skinnum
Definition
r_entity.h:110
entity_t::as
animState_t as
Definition
r_entity.h:117
entity_t::entity_s
entity_s(int flag=RF_NONE)
Definition
r_entity.h:130
entity_t::texture
const image_t * texture
Definition
r_entity.h:123
entity_t::transform
transform_t transform
Definition
r_entity.h:119
entity_t::tagent
struct entity_s * tagent
Definition
r_entity.h:106
entity_t::oldorigin
vec3_t oldorigin
Definition
r_entity.h:102
entity_t::eBox
AABB eBox
Definition
r_entity.h:103
entity_t::isOriginBrushModel
bool isOriginBrushModel
Definition
r_entity.h:115
image_t
Definition
r_image.h:61
lighting_t
lighting structure which contains static and dynamic lighting info for entities
Definition
r_lighting.h:29
transform_t
entity transform matrix
Definition
r_entity.h:85
transform_t::matrix
float matrix[16]
Definition
r_entity.h:88
transform_t::done
bool done
Definition
r_entity.h:86
transform_t::transform_s
transform_s()
Definition
r_entity.h:90
transform_t::processing
bool processing
Definition
r_entity.h:87
vec_t
float vec_t
Definition
ufotypes.h:37
vec3_t
vec_t vec3_t[3]
Definition
ufotypes.h:39
vec4_t
vec_t vec4_t[4]
Definition
ufotypes.h:40
VectorClear
#define VectorClear(a)
Definition
vector.h:55
Vector4Clear
#define Vector4Clear(a)
Definition
vector.h:57
VectorCopy
#define VectorCopy(src, dest)
Definition
vector.h:51
src
client
renderer
r_entity.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0