#include "../renderer/r_entity.h"
Go to the source code of this file.
Data Structures | |
struct | le_s |
a local entity More... | |
struct | localModel_s |
local models More... | |
Defines | |
#define | MAX_LE_PATHLENGTH 32 |
#define | IS_MODE_FIRE_RIGHT(x) ((x) == M_FIRE_R || (x) == M_PEND_FIRE_R) |
#define | IS_MODE_FIRE_LEFT(x) ((x) == M_FIRE_L || (x) == M_PEND_FIRE_L) |
#define | IS_MODE_FIRE_HEADGEAR(x) ((x) == M_FIRE_HEADGEAR) |
#define | IS_MODE_FIRE_PENDING(x) ((x) == M_PEND_FIRE_L || (x) == M_PEND_FIRE_R) |
#define | MAX_LOCALMODELS 512 |
#define | LE_IsStunned(le) (((le)->state & STATE_STUN) & ~STATE_DEAD) |
#define | LE_IsDead(le) ((le)->state & STATE_DEAD) |
#define | LE_IsPaniced(le) ((le)->state & STATE_PANIC) |
#define | LE_IsCrouched(le) ((le)->state & STATE_CROUCHED) |
#define | LE_IsItem(le) ((le)->type == ET_ITEM) |
#define | LE_IsCivilian(le) ((le)->team == TEAM_CIVILIAN) |
#define | LE_IsAlien(le) ((le)->team == TEAM_ALIEN) |
#define | LE_IsPhalanx(le) ((le)->team == TEAM_PHALANX) |
#define | LE_GetAnimationIndexForDeath(le) ((le)->state & MAX_DEATH) |
Valid indices from 1 - MAX_DEATH. | |
#define | LE_NotFoundError(entnum) _LE_NotFoundError(entnum, __FILE__, __LINE__) |
Typedefs | |
typedef struct le_s | le_t |
a local entity | |
typedef struct localModel_s | localModel_t |
local models | |
Enumerations | |
enum | actorModes_t { M_MOVE, M_FIRE_R, M_FIRE_L, M_FIRE_HEADGEAR, M_PEND_MOVE, M_PEND_FIRE_R, M_PEND_FIRE_L } |
Actor actions. More... | |
Functions | |
const char * | LE_GetAnim (const char *anim, int right, int left, int state) |
Get the correct animation for the given actor state and weapons. | |
void | LE_AddProjectile (const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t impact, int normal, le_t *leVictim) |
void | LE_AddGrenade (const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t v0, int dt, le_t *leVictim) |
void | LE_AddAmbientSound (const char *sound, const vec3_t origin, int levelflags, float volume, float attenuation) |
Adds ambient sounds from misc_sound entities. | |
int | LE_ActorGetStepTime (const le_t *le, const pos3_t pos, const pos3_t oldPos, const int dir, const int sped) |
void | LE_SetThink (le_t *le, void(*think)(le_t *le)) |
void | LE_ExecuteThink (le_t *le) |
Call think function for the given local entity if its still in use. | |
void | LE_Think (void) |
Calls the le think function and updates the animation. The animation updated even if the particular local entity is invisible for the client. This ensures, that an animation is always lerped correctly and won't magically start again once the local entity gets visible again. | |
void | LET_StartIdle (le_t *le) |
Change the animation of an actor to the idle animation (which can be panic, dead or stand). | |
void | LET_Appear (le_t *le) |
void | LET_StartPathMove (le_t *le) |
Change the actors animation to walking. | |
void | LET_BrushModel (le_t *le) |
void | LE_DoEndPathMove (le_t *le) |
Ends the move of an actor. | |
void | LM_Think (void) |
void | LMT_Init (localModel_t *localModel) |
localModel_t * | LM_AddModel (const char *model, const vec3_t origin, const vec3_t angles, int entnum, int levelflags, int flags, const vec3_t scale) |
Prepares local (not known or handled by the server) models to the map, which will be added later in LM_AddToScene(). | |
void | LM_Perish (struct dbuffer *msg) |
void | LM_AddToScene (void) |
Add the local models to the scene. | |
qboolean | LE_BrushModelAction (le_t *le, entity_t *ent) |
Add function for brush models. | |
void | CL_RecalcRouting (const le_t *le) |
void | CL_CompleteRecalcRouting (void) |
qboolean | LE_IsLivingAndVisibleActor (const le_t *le) |
Checks whether the given le is a living and visible actor. | |
qboolean | LE_IsLivingActor (const le_t *le) |
Checks whether the given le is a living actor (but might be hidden). | |
qboolean | LE_IsActor (const le_t *le) |
Checks whether the given le is a living actor. | |
le_t * | LE_Add (int entnum) |
Add a new local entity to the scene. | |
le_t * | LE_Get (int entnum) |
Searches all local entities for the one with the searched entnum. | |
le_t * | LE_GetNextInUse (le_t *lastLE) |
Iterate through the entities that are in use. | |
le_t * | LE_GetNext (le_t *lastLE) |
Iterate through the list of entities. | |
void | LE_Lock (le_t *le) |
Markes a le_t struct as locked. Should be called at the beginning of an event handler on this le_t, and paired with a LE_Unlock at the end. | |
void | LE_Unlock (le_t *le) |
Unlocks a previously locked le_t struct. | |
qboolean | LE_IsLocked (int entnum) |
Checks if a given le_t structure is locked, i.e., used by another event at this time. | |
void | _LE_NotFoundError (int entnum, const char *file, const int line) __attribute__((noreturn)) |
le_t * | LE_Find (int type, const pos3_t pos) |
Searches a local entity on a given grid field. | |
le_t * | LE_FindRadius (le_t *from, const vec3_t org, float rad, entity_type_t type) |
Returns entities that have origins within a spherical area. | |
le_t * | LE_GetFromPos (const pos3_t pos) |
Searches a local entity on a given grid field. | |
void | LE_PlaceItem (le_t *le) |
void | LE_Cleanup (void) |
Cleanup unused LE inventories that the server sent to the client also free some unused LE memory. | |
void | LE_AddToScene (void) |
void | LE_CenterView (const le_t *le) |
Center the camera on the local entity's origin. | |
trace_t | CL_Trace (const vec3_t start, const vec3_t end, const vec3_t mins, const vec3_t maxs, const le_t *passle, le_t *passle2, int contentmask, int worldLevel) |
Moves the given mins/maxs volume through the world from start to end. | |
void | LM_Register (void) |
Register misc_models. | |
localModel_t * | LM_GetByID (const char *id) |
Variables | |
static const vec3_t | player_mins = { -PLAYER_WIDTH, -PLAYER_WIDTH, PLAYER_MIN } |
static const vec3_t | player_maxs = { PLAYER_WIDTH, PLAYER_WIDTH, PLAYER_STAND } |
static const vec3_t | player_dead_maxs = { PLAYER_WIDTH, PLAYER_WIDTH, PLAYER_DEAD } |
cvar_t * | cl_le_debug |
cvar_t * | cl_leshowinvis |
Definition in file cl_localentity.h.
#define IS_MODE_FIRE_HEADGEAR | ( | x | ) | ((x) == M_FIRE_HEADGEAR) |
Definition at line 45 of file cl_localentity.h.
Referenced by CL_ActorFireModeActivated(), CL_ActorShoot(), and HUD_UpdateActorFireMode().
#define IS_MODE_FIRE_LEFT | ( | x | ) | ((x) == M_FIRE_L || (x) == M_PEND_FIRE_L) |
Definition at line 44 of file cl_localentity.h.
Referenced by CL_ActorFireModeActivated(), CL_ActorShoot(), and HUD_UpdateActorFireMode().
#define IS_MODE_FIRE_PENDING | ( | x | ) | ((x) == M_PEND_FIRE_L || (x) == M_PEND_FIRE_R) |
Definition at line 46 of file cl_localentity.h.
Referenced by CL_GetHitProbability().
#define IS_MODE_FIRE_RIGHT | ( | x | ) | ((x) == M_FIRE_R || (x) == M_PEND_FIRE_R) |
Definition at line 43 of file cl_localentity.h.
Referenced by CL_ActorFireModeActivated(), and CL_ActorShoot().
#define LE_GetAnimationIndexForDeath | ( | le | ) | ((le)->state & MAX_DEATH) |
Valid indices from 1 - MAX_DEATH.
Definition at line 200 of file cl_localentity.h.
Referenced by CL_ActorDie(), and LET_StartIdle().
#define LE_IsAlien | ( | le | ) | ((le)->team == TEAM_ALIEN) |
Definition at line 196 of file cl_localentity.h.
Referenced by AL_CollectingAliens(), and CL_AddTargetingBox().
#define LE_IsCivilian | ( | le | ) | ((le)->team == TEAM_CIVILIAN) |
Definition at line 195 of file cl_localentity.h.
Referenced by CL_DrawLineOfSight(), CL_NextAlienVisibleFromActor_f(), CL_TargetingStraight(), and UI_RadarNodeGetActorColor().
#define LE_IsCrouched | ( | le | ) | ((le)->state & STATE_CROUCHED) |
Definition at line 192 of file cl_localentity.h.
Referenced by CL_ActorConditionalMoveCalc(), CL_ActorMaximumMove(), CL_ActorMoveLength(), CL_ActorMoveMode(), CL_ActorStateChange(), CL_ActorTraceMove(), CL_ActorVis(), CL_AddPathingBox(), CL_DrawLineOfSight(), CL_GetEventTime(), CL_GetHitProbability(), CL_TargetingStraight(), HUD_RefreshButtons(), HUD_UpdateCursor(), and LE_DoPathMove().
#define LE_IsDead | ( | le | ) | ((le)->state & STATE_DEAD) |
Definition at line 190 of file cl_localentity.h.
Referenced by AII_CollectingItems(), AL_CollectingAliens(), CL_ActorAddToTeamList(), CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorSelect(), CL_ActorSelectNext(), CL_ActorVis(), CL_AddActor(), CL_AddUGV(), HUD_UpdateAllActors(), LE_IsLivingActor(), LET_StartIdle(), UI_RadarNodeDrawActor(), and UI_RadarNodeGetActorColor().
#define LE_IsItem | ( | le | ) | ((le)->type == ET_ITEM) |
Definition at line 194 of file cl_localentity.h.
Referenced by AII_CollectingItems(), CL_InvAdd(), CL_InvDel(), LE_Cleanup(), and LE_PlaceItem().
#define LE_IsPaniced | ( | le | ) | ((le)->state & STATE_PANIC) |
Definition at line 191 of file cl_localentity.h.
Referenced by HUD_UpdateActor(), and LET_StartIdle().
#define LE_IsPhalanx | ( | le | ) | ((le)->team == TEAM_PHALANX) |
Definition at line 197 of file cl_localentity.h.
#define LE_IsStunned | ( | le | ) | (((le)->state & STATE_STUN) & ~STATE_DEAD) |
Definition at line 188 of file cl_localentity.h.
Referenced by AL_CollectingAliens(), CL_ActorConfirmAction_f(), CL_ActorDie(), CL_ActorRemoveFromTeamList(), CL_ActorRevitalised(), CL_ActorSearchAtGridPos(), CL_ActorStartShoot(), CL_AddActor(), CL_BuildForbiddenList(), LE_IsLivingActor(), and LE_PlaySoundFileAndParticleForSurface().
#define LE_NotFoundError | ( | entnum | ) | _LE_NotFoundError(entnum, __FILE__, __LINE__) |
Definition at line 238 of file cl_localentity.h.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoorAction(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorReactionFireChange(), CL_ActorReservationChange(), CL_ActorResetClientAction(), CL_ActorRevitalised(), CL_ActorStateChange(), CL_ActorStats(), CL_DoorClose(), CL_DoorOpen(), CL_EntPerish(), CL_Explode(), CL_GetEventTime(), and CL_ParticleAppear().
#define MAX_LE_PATHLENGTH 32 |
Definition at line 30 of file cl_localentity.h.
Referenced by CL_ActorDoMove().
#define MAX_LOCALMODELS 512 |
Definition at line 144 of file cl_localentity.h.
Referenced by LM_AddModel().
typedef struct localModel_s localModel_t |
local models
enum actorModes_t |
Actor actions.
Definition at line 33 of file cl_localentity.h.
void _LE_NotFoundError | ( | int | entnum, | |
const char * | file, | |||
const int | line | |||
) |
Definition at line 1035 of file cl_localentity.c.
References Cmd_ExecuteString(), Com_Error(), and ERR_DROP.
void CL_CompleteRecalcRouting | ( | void | ) |
Definition at line 59 of file cl_localentity.c.
References cl, Grid_RecalcRouting(), i, le_s::inlineModelName, LE_GenerateInlineModelList(), and le_s::model1.
Referenced by CL_Reset().
void CL_RecalcRouting | ( | const le_t * | le | ) |
[in] | le | A local entity of a brush model (func_breakable, func_door, ...) |
Definition at line 78 of file cl_localentity.c.
References cl, CL_ActorConditionalMoveCalc(), Grid_RecalcRouting(), le_s::inlineModelName, LE_GenerateInlineModelList(), le_s::model1, and selActor.
Referenced by CL_AddBrushModel(), CL_DoorClose(), CL_DoorOpen(), and CL_Explode().
trace_t CL_Trace | ( | const vec3_t | start, | |
const vec3_t | end, | |||
const vec3_t | mins, | |||
const vec3_t | maxs, | |||
const le_t * | passle, | |||
le_t * | passle2, | |||
int | contentmask, | |||
int | worldLevel | |||
) |
Moves the given mins/maxs volume through the world from start to end.
[in] | start | Start vector to start the trace from |
[in] | end | End vector to stop the trace at |
[in] | mins | Bounding box used for tracing |
[in] | maxs | Bounding box used for tracing |
[in] | passle | Ignore this local entity in the trace (might be NULL) |
[in] | passle2 | Ignore this local entity in the trace (might be NULL) |
[in] | contentmask | Searched content the trace should watch for |
[in] | worldLevel | The worldlevel (0-7) to calculate the levelmask for the trace from |
Definition at line 1537 of file cl_localentity.c.
References moveclip_t::boxmaxs, moveclip_t::boxmins, cl, CL_ClipMoveToLEs(), CL_TraceBounds(), CM_CompleteBoxTrace(), moveclip_t::contentmask, moveclip_t::end, trace_s::fraction, trace_s::le, moveclip_t::maxs, moveclip_t::mins, moveclip_t::passle, moveclip_t::passle2, moveclip_t::start, and moveclip_t::trace.
Referenced by CL_ActorVis(), CL_ParticleRun2(), CL_TargetingGrenade(), CL_TargetingStraight(), and LE_PlayFootStepSound().
int LE_ActorGetStepTime | ( | const le_t * | le, | |
const pos3_t | pos, | |||
const pos3_t | oldPos, | |||
const int | dir, | |||
const int | speed | |||
) |
sqrt(2) for diagonal movement
Definition at line 508 of file cl_localentity.c.
References BASE_DIRECTIONS, cl, CORE_DIRECTIONS, dest, DIRECTION_FALL, le_s::fieldSize, Grid_PosToVec(), and UNIT_SIZE.
Referenced by CL_ActorDoMoveTime(), CL_GetEventTime(), and LE_DoPathMove().
le_t* LE_Add | ( | int | entnum | ) |
Add a new local entity to the scene.
[in] | entnum | The entity number (server side) |
Definition at line 1005 of file cl_localentity.c.
References ACTOR_SIZE_NORMAL, cl, Com_Error(), le_s::entnum, ERR_DROP, le_s::fieldSize, le_s::inuse, LE_GetNext(), MAX_EDICTS, and qtrue.
Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_AddBrushModel(), CL_AddEdict(), CL_EntAppear(), LE_AddAmbientSound(), LE_AddGrenade(), and LE_AddProjectile().
void LE_AddAmbientSound | ( | const char * | sound, | |
const vec3_t | origin, | |||
int | levelflags, | |||
float | volume, | |||
float | attenuation | |||
) |
Adds ambient sounds from misc_sound entities.
Definition at line 962 of file cl_localentity.c.
References le_s::attenuation, cl_leshowinvis, Com_DPrintf(), Com_Printf(), DEBUG_SOUND, ET_SOUND, f, cvar_s::integer, le_s::invis, LE_Add(), le_s::levelflags, le_s::origin, S_LoadSample(), le_s::sample, SND_VOLUME_DEFAULT, le_s::type, VectorCopy, and le_s::volume.
Referenced by SP_misc_sound().
void LE_AddGrenade | ( | const fireDef_t * | fd, | |
int | flags, | |||
const vec3_t | muzzle, | |||
const vec3_t | v0, | |||
int | dt, | |||
le_t * | leVictim | |||
) |
[in] | fd | The grenade fire definition |
[in] | flags | bitmask: SF_BODY, SF_IMPACT, SF_BOUNCING, SF_BOUNCED |
[in] | muzzle | starting/location vector |
[in] | v0 | velocity vector |
[in] | dt | delta seconds |
Definition at line 863 of file cl_localentity.c.
References ptl_s::angles, fireDef_s::bounce, fireDef_s::bounceSound, cl, cl_leshowinvis, CL_ParticleSpawn(), crand(), le_s::dir, le_s::endTime, le_s::fd, GRAVITY, fireDef_s::hitBody, fireDef_s::hitBodySound, fireDef_s::impact, fireDef_s::impactSound, cvar_s::integer, le_s::inuse, le_s::invis, LE_Add(), LE_ExecuteThink(), LE_SetThink(), LET_Projectile(), ptl_s::omega, fireDef_s::projectile, le_s::ptl, qfalse, le_s::ref1, le_s::ref2, le_s::ref3, SF_BODY, SF_BOUNCING, SF_IMPACT, fireDef_s::splrad, and VectorSet.
Referenced by CL_ActorDoThrow().
void LE_AddProjectile | ( | const fireDef_t * | fd, | |
int | flags, | |||
const vec3_t | muzzle, | |||
const vec3_t | impact, | |||
int | normal, | |||
le_t * | leVictim | |||
) |
Definition at line 705 of file cl_localentity.c.
References ptl_s::angles, fireDef_s::bounce, fireDef_s::bounceSound, bytedirs, cl, CL_ActorPlaySound(), cl_leshowinvis, CL_ParticleSpawn(), csi, csi_s::damStunGas, le_s::dir, objDef_s::dmgtype, le_s::endTime, le_s::fd, fireDef_s::hitBody, fireDef_s::hitBodySound, fireDef_s::impact, fireDef_s::impactAttenuation, fireDef_s::impactSound, cvar_s::integer, le_s::inuse, le_s::invis, LE_ActorBodyHit(), LE_Add(), LE_ExecuteThink(), LE_SetThink(), LET_Projectile(), fireDef_s::obj, le_s::origin, fireDef_s::projectile, le_s::ptl, qfalse, le_s::ref1, le_s::ref2, le_s::ref3, ptl_s::s, S_LoadSample(), S_PlaySample(), SF_BODY, SF_BOUNCING, SF_IMPACT, ptl_s::size, SND_HURT, SND_VOLUME_WEAPONS, fireDef_s::speed, fireDef_s::splrad, ptl_s::v, VecToAngles(), VectorLength(), VectorMA(), VectorScale, and VectorSubtract.
Referenced by CL_ActorDoShoot().
void LE_AddToScene | ( | void | ) |
Definition at line 1252 of file cl_localentity.c.
References ACTOR_SIZE_2x2, ACTOR_SIZE_NORMAL, le_s::addFunc, le_s::alpha, le_s::angles, le_s::as, cl, CL_ParticleSpawn(), cl_worldlevel, le_s::contents, CONTENTS_DETAIL, CONTENTS_SOLID, le_s::fieldSize, i, cvar_s::integer, le_s::inuse, le_s::invis, LE_IsOriginBrush(), le_s::levelflags, le_s::model1, ModelOffset, le_s::origin, le_s::pos, qfalse, qtrue, R_AddEntity(), R_EntityAddToOrigin(), R_EntitySetOrigin(), le_s::removeNextFrame, le_s::skinnum, VectorAdd, and VectorCopy.
Referenced by CL_ViewRender().
Add function for brush models.
Definition at line 912 of file cl_localentity.c.
References le_s::angles, ET_BREAKABLE, ET_DOOR, ET_ROTATING, le_s::maxs, le_s::mins, le_s::origin, qtrue, R_EntityGetOrigin(), le_s::type, and VectorCopy.
Referenced by CL_AddBrushModel().
void LE_CenterView | ( | const le_t * | le | ) |
Center the camera on the local entity's origin.
le | The local entity which origin is used to center the camera |
Definition at line 1048 of file cl_localentity.c.
References cl, cl_centerview, Cvar_SetValue(), cvar_s::integer, le_s::origin, le_s::pos, and VectorCopy.
Referenced by CL_ActorAppear(), and CL_ActorSelectList().
void LE_Cleanup | ( | void | ) |
Cleanup unused LE inventories that the server sent to the client also free some unused LE memory.
Definition at line 1334 of file cl_localentity.c.
References cl, CL_ActorCleanup(), cls, Com_DPrintf(), csi, DEBUG_CLIENT, inventoryInterface_s::EmptyContainer, le_s::i, client_static_s::i, i, csi_s::idFloor, le_s::inuse, INVDEF, LE_IsActor(), LE_IsItem, and qfalse.
Referenced by CL_ClearState().
void LE_DoEndPathMove | ( | le_t * | le | ) |
Ends the move of an actor.
Definition at line 571 of file cl_localentity.c.
References CL_ActorConditionalMoveCalc(), Com_Error(), ERR_DROP, ET_ITEM, FLOOR, LE_ExecuteThink(), LE_Find(), LE_SetThink(), LE_Unlock(), LET_StartIdle(), le_s::newPos, le_s::pathLength, le_s::pathPos, le_s::pos, le_s::team, and VectorCompare.
Referenced by CL_ActorDoMove(), and LET_PathMove().
void LE_ExecuteThink | ( | le_t * | le | ) |
Call think function for the given local entity if its still in use.
Definition at line 305 of file cl_localentity.c.
References Com_DPrintf(), DEBUG_EVENTSYS, le_s::entnum, le_s::inuse, and le_s::think.
Referenced by LE_AddGrenade(), LE_AddProjectile(), LE_DoEndPathMove(), LE_Think(), and LET_StartPathMove().
Searches a local entity on a given grid field.
[in] | type | Entity type |
[in] | pos | The grid pos to search for an item of the given type |
Definition at line 1218 of file cl_localentity.c.
References LE_GetNextInUse(), le_s::pos, le_s::type, and VectorCompare.
Referenced by CL_ActorRevitalised(), and LE_DoEndPathMove().
le_t* LE_FindRadius | ( | le_t * | from, | |
const vec3_t | org, | |||
float | rad, | |||
entity_type_t | type | |||
) |
Returns entities that have origins within a spherical area.
[in] | from | The entity to start the search from. NULL will start from the beginning. |
[in] | org | The origin that is the center of the circle. |
[in] | rad | radius to search an edict in. |
[in] | type | Type of local entity. ET_NULL to ignore the type. |
Definition at line 1194 of file cl_localentity.c.
References ET_NULL, LE_GetNextInUse(), le_s::maxs, le_s::mins, le_s::origin, le_s::type, and VectorLength().
le_t* LE_Get | ( | int | entnum | ) |
Searches all local entities for the one with the searched entnum.
[in] | entnum | The entity number (server side) |
Definition at line 1064 of file cl_localentity.c.
References le_s::entnum, LE_GetNextInUse(), and SKIP_LOCAL_ENTITY.
Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoorAction(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorReactionFireChange(), CL_ActorReservationChange(), CL_ActorResetClientAction(), CL_ActorRevitalised(), CL_ActorStartShoot(), CL_ActorStateChange(), CL_ActorStats(), CL_AddBrushModel(), CL_AddEdict(), CL_DoorClose(), CL_DoorOpen(), CL_EntAppear(), CL_EntDestroy(), CL_EntPerish(), CL_Explode(), CL_GetEventTime(), CL_InvAdd(), CL_InvAmmo(), CL_InvDel(), CL_InvReload(), CL_ParticleAppear(), and LE_IsLocked().
const char* LE_GetAnim | ( | const char * | anim, | |
int | right, | |||
int | left, | |||
int | state | |||
) |
Get the correct animation for the given actor state and weapons.
[in] | anim | Type of animation (for example "stand", "walk") |
[in] | right | ods index to determine the weapon in the actors right hand |
[in] | left | ods index to determine the weapon in the actors left hand |
[in] | state | the actors state - e.g. STATE_CROUCHED (crounched animations) have a 'c' in front of their animation definitions (see *.anm files for characters) |
Definition at line 364 of file cl_localentity.c.
References objDef_s::animationIndex, Com_sprintf(), INVSH_GetItemByIDX(), NONE, Q_strncpyz(), qfalse, qtrue, STATE_CROUCHED, objDef_s::type, and type.
Referenced by CL_ActorDoShoot(), CL_ActorStartShoot(), LET_StartIdle(), and LET_StartPathMove().
Searches a local entity on a given grid field.
[in] | pos | The grid pos to search for an item of the given type |
Definition at line 1130 of file cl_localentity.c.
References LE_GetNextInUse(), le_s::pos, and VectorCompare.
Referenced by CL_GetHitProbability().
Iterate through the list of entities.
lastLE | The entity found in the previous iteration; if NULL, we start at the beginning |
Definition at line 1147 of file cl_localentity.c.
References cl.
Referenced by LE_Add(), LE_GetNextInUse(), and LE_Think().
Iterate through the entities that are in use.
lastLE | The entity found in the previous iteration; if NULL, we start at the beginning |
Definition at line 1176 of file cl_localentity.c.
References le_s::inuse, and LE_GetNext().
Referenced by AII_CollectingItems(), AL_CollectingAliens(), CL_ActorConfirmAction_f(), CL_ActorSearchAtGridPos(), CL_BuildForbiddenList(), CL_ClipMoveToLEs(), CL_EntPerish(), CL_ViewLoadMedia(), LE_Find(), LE_FindRadius(), LE_GenerateInlineModelList(), LE_Get(), LE_GetFromPos(), LE_PlaceItem(), S_Frame(), and UI_RadarNodeDraw().
Checks whether the given le is a living actor.
[in] | le | The local entity to perform the check for |
Definition at line 181 of file cl_localentity.c.
References ET_ACTOR, ET_ACTOR2x2, ET_ACTORHIDDEN, and le_s::type.
Referenced by AII_CollectingItems(), AL_CollectingAliens(), CL_ActorDoMove(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorInvMove(), CL_ActorStateChange(), LE_Cleanup(), and LE_IsLivingActor().
Checks whether the given le is a living actor (but might be hidden).
[in] | le | The local entity to perform the check for |
Definition at line 193 of file cl_localentity.c.
References LE_IsActor(), LE_IsDead, and LE_IsStunned.
Referenced by CL_ActorAppear(), CL_ActorConfirmAction_f(), CL_ActorDie(), CL_ActorRevitalised(), CL_ActorStartShoot(), CL_ActorStateChange(), and LE_IsLivingAndVisibleActor().
Checks whether the given le is a living and visible actor.
[in] | le | The local entity to perform the check for |
Definition at line 205 of file cl_localentity.c.
References ET_ACTORHIDDEN, le_s::invis, LE_IsLivingActor(), qfalse, and le_s::type.
Referenced by CL_ActorSearchAtGridPos(), CL_BuildForbiddenList(), CL_EntPerish(), CL_NextAlien_f(), CL_NextAlienVisibleFromActor_f(), and LE_PlaySoundFileAndParticleForSurface().
qboolean LE_IsLocked | ( | int | entnum | ) |
Checks if a given le_t structure is locked, i.e., used by another event at this time.
entnum | the entnum of the le_t struct involved. |
Definition at line 1086 of file cl_localentity.c.
References LE_Get(), and le_s::locked.
Referenced by CL_CheckDefault().
void LE_Lock | ( | le_t * | le | ) |
Markes a le_t struct as locked. Should be called at the beginning of an event handler on this le_t, and paired with a LE_Unlock at the end.
le | The struct to be locked. |
Definition at line 1099 of file cl_localentity.c.
References Com_Error(), le_s::entnum, ERR_DROP, le_s::locked, and qtrue.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), and CL_ActorRevitalised().
void LE_PlaceItem | ( | le_t * | le | ) |
[in] | le | The local entity (ET_ITEM) with the floor container |
Definition at line 820 of file cl_localentity.c.
References le_s::angles, objDef_s::center, cl, cls, Com_Error(), ERR_DROP, ET_ACTOR, ET_ACTOR2x2, le_s::fieldSize, FLOOR, Grid_PosToVec(), GROUND_DELTA, objDef_s::id, objDef_s::idx, LE_BiggestItem(), LE_GetNextInUse(), LE_IsItem, le_s::model1, client_static_s::modelPool, le_s::origin, le_s::pos, qtrue, le_s::removeNextFrame, ROLL, le_s::type, VectorCompare, and VectorSubtract.
Referenced by CL_InvAdd(), and CL_InvDel().
Definition at line 239 of file cl_localentity.c.
References Com_DPrintf(), DEBUG_EVENTSYS, le_s::entnum, and le_s::think.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorRevitalised(), CL_ActorStateChange(), CL_AddBrushModel(), CL_InvAdd(), CL_InvDel(), LE_AddGrenade(), LE_AddProjectile(), LE_DoEndPathMove(), LET_StartIdle(), and LET_StartPathMove().
void LE_Think | ( | void | ) |
Calls the le think function and updates the animation. The animation updated even if the particular local entity is invisible for the client. This ensures, that an animation is always lerped correctly and won't magically start again once the local entity gets visible again.
Definition at line 323 of file cl_localentity.c.
References le_s::as, ca_active, cls, client_static_s::frametime, LE_ExecuteThink(), LE_GetNext(), le_s::model1, R_AnimRun(), and client_static_s::state.
Referenced by CL_Frame().
void LE_Unlock | ( | le_t * | le | ) |
Unlocks a previously locked le_t struct.
le | The le_t to unlock. |
Definition at line 1118 of file cl_localentity.c.
References Com_Error(), le_s::entnum, ERR_DROP, le_s::locked, and qfalse.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorRevitalised(), and LE_DoEndPathMove().
void LET_Appear | ( | le_t * | le | ) |
void LET_BrushModel | ( | le_t * | le | ) |
Definition at line 932 of file cl_localentity.c.
References le_s::angles, cl, le_s::dir, ET_ROTATING, le_s::rotationSpeed, le_s::speed, le_s::thinkDelay, and le_s::type.
Referenced by CL_AddBrushModel().
void LET_StartIdle | ( | le_t * | le | ) |
Change the animation of an actor to the idle animation (which can be panic, dead or stand).
Definition at line 423 of file cl_localentity.c.
References le_s::as, ET_ACTORHIDDEN, LE_GetAnim(), LE_GetAnimationIndexForDeath, LE_IsDead, LE_IsPaniced, LE_SetThink(), le_s::left, le_s::model1, le_s::pathLength, le_s::pathPos, R_AnimChange(), le_s::right, le_s::state, le_s::type, and va().
Referenced by CL_ActorAppear(), CL_ActorRevitalised(), CL_ActorStateChange(), CL_InvAdd(), CL_InvDel(), and LE_DoEndPathMove().
void LET_StartPathMove | ( | le_t * | le | ) |
Change the actors animation to walking.
Definition at line 653 of file cl_localentity.c.
References le_s::as, animState_s::change, Com_Printf(), le_s::entnum, LE_ExecuteThink(), LE_GetAnim(), LE_SetThink(), le_s::left, LET_PathMove(), le_s::model1, le_s::pnum, R_AnimChange(), le_s::right, le_s::state, and le_s::team.
Referenced by CL_ActorDoMove().
localModel_t* LM_AddModel | ( | const char * | model, | |
const vec3_t | origin, | |||
const vec3_t | angles, | |||
int | entnum, | |||
int | levelflags, | |||
int | renderFlags, | |||
const vec3_t | scale | |||
) |
Prepares local (not known or handled by the server) models to the map, which will be added later in LM_AddToScene().
[in] | model | The model name. |
[in] | origin | Origin of the model (position on map). |
[in] | angles | Angles of the model (how it should be rotated after adding to map). |
[in] | scale | Scaling of the model (how it should be scaled after adding to map). |
[in] | entnum | Entity number. |
[in] | levelflags | The levels in which the entity resides/is visible. |
[in] | renderFlags | The flags for the renderer, eg. 'translucent'. |
Definition at line 273 of file cl_localentity.c.
References localModel_s::angles, cl, Com_Error(), localModel_s::entnum, ERR_DROP, localModel_s::inuse, localModel_s::levelflags, LM_Find(), MAX_LOCALMODELS, localModel_s::name, localModel_s::origin, Q_strncpyz(), qtrue, localModel_s::renderFlags, localModel_s::scale, and VectorCopy.
Referenced by SP_misc_model().
void LM_AddToScene | ( | void | ) |
Add the local models to the scene.
Definition at line 156 of file cl_localentity.c.
References LM_AddToSceneOrder(), qfalse, and qtrue.
Referenced by CL_ViewRender().
localModel_t* LM_GetByID | ( | const char * | id | ) |
Definition at line 246 of file cl_localentity.c.
Referenced by LMT_Init(), and SP_misc_model().
void LM_Perish | ( | struct dbuffer * | msg | ) |
void LM_Register | ( | void | ) |
Register misc_models.
Definition at line 220 of file cl_localentity.c.
References localModel_s::animname, localModel_s::as, animState_s::change, cl, Com_Printf(), i, localModel_s::inuse, localModel_s::model, localModel_s::name, qfalse, R_AnimChange(), and R_RegisterModelShort().
Referenced by CL_ViewLoadMedia().
void LM_Think | ( | void | ) |
Definition at line 337 of file cl_localentity.c.
References cl, i, and localModel_s::think.
Referenced by CL_SpawnParseEntitystring().
void LMT_Init | ( | localModel_t * | localModel | ) |
Definition at line 946 of file cl_localentity.c.
References Com_Error(), ERR_DROP, LM_GetByID(), localModel_s::parent, localModel_s::target, and localModel_s::think.
Referenced by SP_misc_model().
Definition at line 38 of file cl_localentity.c.
Referenced by CL_InitLocal().
Definition at line 70 of file cl_main.c.
Referenced by CL_EntAppear(), CL_ParticleAppear(), LE_AddAmbientSound(), LE_AddGrenade(), and LE_AddProjectile().
const vec3_t player_dead_maxs = { PLAYER_WIDTH, PLAYER_WIDTH, PLAYER_DEAD } [static] |
Definition at line 177 of file cl_localentity.h.
Referenced by CL_ActorAppear(), CL_ActorDie(), and CL_ActorStateChange().
const vec3_t player_maxs = { PLAYER_WIDTH, PLAYER_WIDTH, PLAYER_STAND } [static] |
Definition at line 176 of file cl_localentity.h.
Referenced by CL_ActorAppear(), and CL_ActorRevitalised().
const vec3_t player_mins = { -PLAYER_WIDTH, -PLAYER_WIDTH, PLAYER_MIN } [static] |
Definition at line 175 of file cl_localentity.h.
Referenced by CL_ActorAppear().