Libprimis
Imprimis' 3D destroyable world engine
Loading...
Searching...
No Matches
ents.h
Go to the documentation of this file.
1
12
#ifndef ENTS_H_
13
#define ENTS_H_
14
15
//constants
16
constexpr
int
maxents = 10000;
17
constexpr
int
crouchtime = 200;
18
constexpr
float
crouchheight = 0.75f;
19
constexpr
int
maxanimparts = 3;
20
//forward declarations for some internal engine parts of objects
21
struct
occludequery;
22
class
ragdolldata;
23
class
model;
24
25
enum
26
{
27
Anim_Mapmodel = 0,
28
Anim_GameSpecific
29
};
30
31
enum
32
{
33
Anim_All = 0x1FF,
34
Anim_Index = 0x1FF,
35
Anim_Loop = (1 << 9),
36
Anim_Clamp = (1 << 10),
37
Anim_Reverse = (1 << 11),
38
Anim_Start = (Anim_Loop | Anim_Clamp),
39
Anim_End = (Anim_Loop | Anim_Clamp | Anim_Reverse),
40
Anim_Dir = 0xE00,
41
Anim_Secondary = 12,
42
Anim_Reuse = 0xFFFFFF,
43
Anim_NoSkin = (1 << 24),
44
Anim_SetTime = (1 << 25),
45
Anim_FullBright = (1 << 26),
46
Anim_NoRender = (1 << 27),
47
Anim_Ragdoll = (1 << 28),
48
Anim_SetSpeed = (1 << 29),
49
Anim_NoPitch = (1 << 30),
50
Anim_Flags = 0xFF000000,
51
};
52
53
enum
54
{
55
EngineEnt_Empty=0,
56
EngineEnt_Light,
57
EngineEnt_Mapmodel,
58
EngineEnt_Playerstart,
59
EngineEnt_Particles,
60
EngineEnt_Sound,
61
EngineEnt_Spotlight,
62
EngineEnt_Decal,
63
EngineEnt_GameSpecific,
64
};
65
66
enum
67
{
68
PhysEntState_Float = 0,
69
PhysEntState_Fall,
70
PhysEntState_Slide,
71
PhysEntState_Slope,
72
PhysEntState_Floor,
73
PhysEntState_StepUp,
74
PhysEntState_StepDown,
75
PhysEntState_Bounce,
76
};
77
81
struct
entity
82
{
83
vec
o
;
84
short
attr1, attr2, attr3, attr4,
attr5
;
85
uchar
type
;
86
uchar reserved;
87
};
88
92
struct
extentity
:
entity
93
{
94
int
flags;
95
extentity
*attached;
96
97
extentity
();
98
99
bool
spawned()
const
;
100
void
setspawned(
bool
val);
101
void
setspawned();
102
void
clearspawned();
103
};
104
110
struct
physent
111
{
112
vec
o, vel,
falling
;
113
vec
deltapos,
newpos
;
114
float
yaw, pitch, roll;
115
float
maxspeed
;
116
int
timeinair;
117
float
radius, eyeheight, maxheight,
aboveeye
;
118
float
xradius, yradius, zmargin;
119
vec
floor
;
121
int
inwater;
122
bool
jumping;
123
124
// The velocity type: `move` is movement along camera axis while `strafe` is
125
// side-to-side movement perpendicular to camera axis.
126
char
move, strafe, crouching;
127
128
uchar
physstate
;
129
uchar state,
editstate
;
131
enum
132
{
133
PhysEnt_Player = 0,
134
PhysEnt_Camera,
135
PhysEnt_Bounce,
136
};
137
uchar
type
;
138
uchar
collidetype
;
140
bool
blocked
;
142
physent
();
143
144
void
resetinterp();
145
void
reset();
146
vec
feetpos(
float
offset = 0)
const
;
147
vec
headpos(
float
offset = 0)
const
;
148
bool
crouched()
const
;
149
};
150
154
struct
modelattach
final
155
{
156
const
char
*tag, *name;
157
int
anim, basetime;
158
vec
*pos;
159
model *m;
160
161
modelattach
();
162
modelattach
(
const
char
*tag,
const
char
*name,
int
anim = -1,
int
basetime = 0);
163
modelattach
(
const
char
*tag,
vec
*pos);
164
};
165
169
struct
animinfo
final
170
{
171
int
anim, frame, range, basetime;
172
float
speed;
173
uint varseed;
174
175
animinfo
();
176
bool
operator==(
const
animinfo
&o)
const
;
177
bool
operator!=(
const
animinfo
&o)
const
;
178
};
179
183
struct
animinterpinfo
final
184
{
185
animinfo
prev, cur;
186
int
lastswitch;
187
void
*lastmodel;
188
189
animinterpinfo
();
190
void
reset();
191
};
192
196
struct
dynent
:
physent
197
{
198
bool
k_left
,
199
k_right
,
200
k_up
,
201
k_down
;
203
animinterpinfo
animinterp[maxanimparts];
204
ragdolldata *ragdoll;
205
occludequery *query;
206
int
lastrendered;
207
208
dynent
();
209
~dynent
();
210
211
void
stopmoving();
212
void
reset();
213
vec
abovehead()
const
;
214
};
215
216
#endif
/* ENTS_H_ */
animinfo
description of a character's animation
Definition
ents.h:170
animinterpinfo
used for animation blending of animated characters
Definition
ents.h:184
dynent
Definition
ents.h:197
dynent::k_down
bool k_down
Definition
ents.h:201
dynent::k_right
bool k_right
Definition
ents.h:199
dynent::k_left
bool k_left
Definition
ents.h:198
dynent::k_up
bool k_up
Definition
ents.h:200
entity
Entity data capable of being saved to disk.
Definition
ents.h:82
entity::o
vec o
Definition
ents.h:83
entity::attr5
short attr5
Definition
ents.h:84
entity::type
uchar type
Definition
ents.h:85
extentity
Extended entity data not of the subset which is saved to disk.
Definition
ents.h:93
modelattach
An representation of a model attachment (e.g. weapon to player).
Definition
ents.h:155
physent
A base object representing a class.
Definition
ents.h:111
physent::floor
vec floor
Definition
ents.h:119
physent::falling
vec falling
Definition
ents.h:112
physent::aboveeye
float aboveeye
Definition
ents.h:117
physent::blocked
bool blocked
Definition
ents.h:140
physent::newpos
vec newpos
Definition
ents.h:113
physent::maxspeed
float maxspeed
Definition
ents.h:115
physent::type
uchar type
Definition
ents.h:137
physent::editstate
uchar editstate
Definition
ents.h:129
physent::collidetype
uchar collidetype
Definition
ents.h:138
physent::physstate
uchar physstate
Definition
ents.h:128
vec
three dimensional Cartesian vector object
Definition
geom.h:185
src
libprimis-headers
ents.h
Generated by
1.12.0