This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/common/entity_def.h

160 lines
5.7 KiB
C

//=======================================================================
// Copyright XashXT Group 2008 ©
// entity_def.h - generic engine edict
//=======================================================================
#ifndef ENTITY_DEF_H
#define ENTITY_DEF_H
// 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
typedef struct entvars_s
{
string_t classname; // ENG [all], NET [all]
string_t globalname; // global entity name transmitted across levels
vec3_t origin; // ENG [all], NET [all]
vec3_t oldorigin; // ENG [all], NET [all]
vec3_t velocity;
vec3_t movedir;
vec3_t angles; // ENG [all], NET [all]
vec3_t oldangles; // ENG [all], NET [all]
vec3_t avelocity; // angular velocity (degrees per second)
vec3_t punchangle; // NET [player], auto-decaying view angle adjustment
vec3_t viewangles; // NET [player], viewing angle (old name was v_angle)
vec3_t delta_angles; // ENG [player], NET [player], viewangles - cmd.angles
int fixangle; // 0 - nothing, 1 - force view angles, 2 - add avelocity
float ideal_pitch;
float pitch_speed;
float ideal_yaw;
float yaw_speed;
int modelindex; // ENG [all], NET [all]
string_t model; // model name
string_t viewmodel; // player's viewmodel (no network updates)
string_t weaponmodel; // NET [all] - sending weaponmodel index, not name
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
// 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
float ltime; // [push]
float nextthink; // time to next call of think function
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;
int sequence; // ENG [all], NET [all], animation sequence
int gaitsequence; // NET [player], movement animation sequence for player (0 for none)
int weaponanim; // NET [all], weaponmodel animation sequencs
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)
float controller[16]; // NET [all], bone controller setting (0..255)
float blending[16]; // NET [all], blending amount between sub-sequences (0..255)
vec3_t attachment[16]; // ENG [all], filled by engine on the client-side
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]
float frags;
int64 weapons; // NET [player], bit mask for available weapons
int64 items; // from Q1, can use for holdable items or user flags
float takedamage;
float maxspeed; // NET [player], uses to limit speed for current client
int deadflag;
vec3_t view_ofs; // NET [player], eye position
int button;
int impulse;
edict_t *chain; // linked list for EntitiesInPHS\PVS
edict_t *dmg_inflictor;
edict_t *enemy;
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
int spawnflags; // spwanflags are used only during level loading
int64 flags; // generic flags that can be send to client
short colormap; // lowbyte topcolor, highbyte bottomcolor
int team; // ENG [player], NET [player], for teamplay
float max_health;
float teleport_time; // ENG [all], NET [all], engine will be reset value on next frame
int armortype;
float armorvalue;
int waterlevel; // ENG [all]
int watertype; // ENG [all]
int contents; // hl-coders: use this instead of pev->skin, to set entity contents
string_t target; // various server strings
string_t targetname;
string_t netname;
string_t message;
string_t noise;
string_t noise1;
string_t noise2;
string_t noise3;
float dmg_take;
float dmg_save;
float dmg;
float dmgtime;
edict_t *pContainingEntity; // filled by engine, don't save, don't modifiy
} entvars_t;
struct edict_s
{
BOOL free; // shared parms
float freetime; // sv.time when the object was freed
int serialnumber; // must match with entity num
union
{
sv_priv_t *pvServerData; // alloced, freed and used by engine only
cl_priv_t *pvClientData; // alloced, freed and used by engine only
};
void *pvPrivateData; // alloced and freed by engine, used by DLLs
entvars_t v; // C exported fields from progs (network relative)
};
#endif//ENTITY_DEF_H