2008-12-15 22:00:00 +01:00
|
|
|
|
//=======================================================================
|
|
|
|
|
// Copyright XashXT Group 2008 <20>
|
2008-12-25 22:00:00 +01:00
|
|
|
|
// entity_def.h - generic engine edict
|
2008-12-15 22:00:00 +01:00
|
|
|
|
//=======================================================================
|
2008-12-25 22:00:00 +01:00
|
|
|
|
#ifndef ENTITY_DEF_H
|
|
|
|
|
#define ENTITY_DEF_H
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
// Legend:
|
|
|
|
|
// ENG - engine can modify this variable for some reasons [only
|
|
|
|
|
// NET - field that shared on client across network
|
|
|
|
|
// Modifiers:
|
|
|
|
|
// [player] - all notify for this field is valid only for client entity
|
|
|
|
|
// [all] - valid for all ents
|
|
|
|
|
// [phys] - valid only for rigid bodies
|
|
|
|
|
// [solid] - only for solid entities
|
|
|
|
|
// [push] - only ents with SOLID_BSP and MOVETYPE_PUSH have affect on this field
|
|
|
|
|
|
2008-12-15 22:00:00 +01:00
|
|
|
|
typedef struct entvars_s
|
|
|
|
|
{
|
2009-01-06 22:00:00 +01:00
|
|
|
|
string_t classname; // ENG [all], NET [all]
|
|
|
|
|
string_t globalname; // global entity name transmitted across levels
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
vec3_t origin; // ENG [all], NET [all]
|
|
|
|
|
vec3_t oldorigin; // ENG [all], NET [all]
|
|
|
|
|
vec3_t velocity;
|
2009-11-02 22:00:00 +01:00
|
|
|
|
vec3_t basevelocity;
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
vec3_t movedir;
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
vec3_t angles; // ENG [all], NET [all]
|
|
|
|
|
vec3_t oldangles; // ENG [all], NET [all]
|
2008-12-21 22:00:00 +01:00
|
|
|
|
vec3_t avelocity; // angular velocity (degrees per second)
|
2009-01-06 22:00:00 +01:00
|
|
|
|
vec3_t punchangle; // NET [player], auto-decaying view angle adjustment
|
|
|
|
|
vec3_t viewangles; // NET [player], viewing angle (old name was v_angle)
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
int fixangle; // 0 - nothing, 1 - force view angles, 2 - add avelocity
|
|
|
|
|
float ideal_pitch;
|
|
|
|
|
float pitch_speed;
|
|
|
|
|
float ideal_yaw;
|
|
|
|
|
float yaw_speed;
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
int modelindex; // ENG [all], NET [all]
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
string_t model; // model name
|
|
|
|
|
string_t viewmodel; // player's viewmodel (no network updates)
|
|
|
|
|
string_t weaponmodel; // NET [all] - sending weaponmodel index, not name
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
vec3_t absmin; // ENG [all] - pfnSetAbsBox passed to modify this values
|
|
|
|
|
vec3_t absmax; // ENG [all] - pfnSetAbsBox passed to modify this values
|
|
|
|
|
vec3_t mins; // ENG [all], NET [solid]
|
|
|
|
|
vec3_t maxs; // ENG [all], NET [solid]
|
|
|
|
|
vec3_t size; // ENG [all], restored on client-side from mins-maxs
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
// physic decsription
|
|
|
|
|
vec3_t m_pmatrix[3]; // ENG [phys]
|
|
|
|
|
vec3_t m_pcentre[3]; // ENG [phys]
|
|
|
|
|
vec3_t force; // ENG [phys], linear physical impulse vector
|
|
|
|
|
vec3_t torque; // ENG [phys], angular physical impulse vector
|
|
|
|
|
float mass; // [phys], physobject mass
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
float ltime; // [push]
|
|
|
|
|
float nextthink; // time to next call of think function
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
int movetype; // ENG [all], NET [all]
|
|
|
|
|
int solid; // ENG [all], NET [all]
|
|
|
|
|
|
|
|
|
|
int skin; // NET [all]
|
|
|
|
|
int body; // NET [all], sub-model selection for studiomodels
|
|
|
|
|
int weaponbody; // NET [all], sub-model selection for weaponmodel
|
|
|
|
|
int weaponskin; // NET [all],
|
|
|
|
|
int effects; // ENG [all], NET [all]
|
|
|
|
|
float gravity; // % of "normal" gravity
|
|
|
|
|
float friction; // inverse elasticity of MOVETYPE_BOUNCE
|
|
|
|
|
float speed;
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
int sequence; // ENG [all], NET [all], animation sequence
|
|
|
|
|
int gaitsequence; // NET [player], movement animation sequence for player (0 for none)
|
|
|
|
|
float frame; // NET [all], % playback position in animation sequences (0..255)
|
|
|
|
|
float animtime; // NET [all], world time when frame was set
|
|
|
|
|
float framerate; // NET [all], animation playback rate (-8x to 8x)
|
2009-10-22 22:00:00 +02:00
|
|
|
|
byte controller[16]; // NET [all], bone controller setting (0..255)
|
|
|
|
|
byte blending[16]; // NET [all], blending amount between sub-sequences (0..255)
|
2009-01-06 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
float scale; // NET [all], sprites and models rendering scale (0..255)
|
|
|
|
|
int rendermode; // NET [all]
|
|
|
|
|
float renderamt; // NET [all]
|
|
|
|
|
vec3_t rendercolor; // NET [all]
|
|
|
|
|
int renderfx; // NET [all]
|
|
|
|
|
|
|
|
|
|
float fov; // NET [player], client fov, used instead m_iFov
|
|
|
|
|
float health; // NET [player]
|
2008-12-15 22:00:00 +01:00
|
|
|
|
float frags;
|
2009-02-01 22:00:00 +01:00
|
|
|
|
int weapons; // NET [player], bit mask for available weapons
|
|
|
|
|
int items; // from Q1, can use for holdable items or user flags
|
2008-12-15 22:00:00 +01:00
|
|
|
|
float takedamage;
|
2009-01-06 22:00:00 +01:00
|
|
|
|
float maxspeed; // NET [player], uses to limit speed for current client
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
int deadflag;
|
2009-01-06 22:00:00 +01:00
|
|
|
|
vec3_t view_ofs; // NET [player], eye position
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
int button;
|
|
|
|
|
int impulse;
|
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
edict_t *chain; // linked list for EntitiesInPHS\PVS
|
2008-12-15 22:00:00 +01:00
|
|
|
|
edict_t *dmg_inflictor;
|
|
|
|
|
edict_t *enemy;
|
2009-01-06 22:00:00 +01:00
|
|
|
|
edict_t *aiment; // NET [all], entity pointer when MOVETYPE_FOLLOW
|
|
|
|
|
edict_t *owner; // NET [all]
|
|
|
|
|
edict_t *groundentity; // NET [all], only if FL_ONGROUND is set
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
int spawnflags; // spwanflags are used only during level loading
|
2009-02-01 22:00:00 +01:00
|
|
|
|
int flags; // generic flags that can be send to client
|
2009-01-06 22:00:00 +01:00
|
|
|
|
|
2008-12-15 22:00:00 +01:00
|
|
|
|
short colormap; // lowbyte topcolor, highbyte bottomcolor
|
2009-01-06 22:00:00 +01:00
|
|
|
|
int team; // ENG [player], NET [player], for teamplay
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
float max_health;
|
2009-01-06 22:00:00 +01:00
|
|
|
|
float teleport_time; // ENG [all], NET [all], engine will be reset value on next frame
|
2008-12-15 22:00:00 +01:00
|
|
|
|
int armortype;
|
|
|
|
|
float armorvalue;
|
2009-01-06 22:00:00 +01:00
|
|
|
|
int waterlevel; // ENG [all]
|
|
|
|
|
int watertype; // ENG [all]
|
|
|
|
|
int contents; // hl-coders: use this instead of pev->skin, to set entity contents
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2009-01-06 22:00:00 +01:00
|
|
|
|
string_t target; // various server strings
|
2008-12-15 22:00:00 +01:00
|
|
|
|
string_t targetname;
|
|
|
|
|
string_t netname;
|
|
|
|
|
string_t message;
|
|
|
|
|
string_t noise;
|
|
|
|
|
string_t noise1;
|
|
|
|
|
string_t noise2;
|
|
|
|
|
string_t noise3;
|
2009-01-06 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
float dmg_take;
|
|
|
|
|
float dmg_save;
|
|
|
|
|
float dmg;
|
|
|
|
|
float dmgtime;
|
|
|
|
|
|
2009-01-11 22:00:00 +01:00
|
|
|
|
edict_t *pContainingEntity; // filled by engine, don't save, don't modifiy
|
2009-11-10 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
// pm_shared test stuff
|
|
|
|
|
int bInDuck;
|
|
|
|
|
int flTimeStepSound; // Next time we can play a step sound
|
|
|
|
|
int flSwimTime; // In process of ducking or ducked already?
|
|
|
|
|
int flDuckTime; // Time we started duck
|
|
|
|
|
int iStepLeft; // 0 - 4
|
|
|
|
|
float flFallVelocity; // falling velocity z
|
|
|
|
|
int oldbuttons; // buttons last usercmd
|
|
|
|
|
int iSpecMode; // OBS_ROAMING etc (was iuser1)
|
|
|
|
|
|
2008-12-15 22:00:00 +01:00
|
|
|
|
} entvars_t;
|
|
|
|
|
|
|
|
|
|
struct edict_s
|
|
|
|
|
{
|
2008-12-26 22:00:00 +01:00
|
|
|
|
BOOL free; // shared parms
|
2008-12-15 22:00:00 +01:00
|
|
|
|
float freetime; // sv.time when the object was freed
|
2008-12-26 22:00:00 +01:00
|
|
|
|
int serialnumber; // must match with entity num
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
sv_priv_t *pvServerData; // alloced, freed and used by engine only
|
|
|
|
|
cl_priv_t *pvClientData; // alloced, freed and used by engine only
|
|
|
|
|
};
|
2008-12-15 22:00:00 +01:00
|
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
|
void *pvPrivateData; // alloced and freed by engine, used by DLLs
|
|
|
|
|
entvars_t v; // C exported fields from progs (network relative)
|
2008-12-15 22:00:00 +01:00
|
|
|
|
};
|
|
|
|
|
|
2008-12-25 22:00:00 +01:00
|
|
|
|
#endif//ENTITY_DEF_H
|