UFO: Alien Invasion
|
#include "../renderer/r_entity.h"
Go to the source code of this file.
Data Structures | |
struct | leStep_s |
struct | le_s |
a local entity More... | |
struct | localModel_s |
local models More... | |
Macros | |
#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 | LE_CHECK_LEVELFLAGS 0x0001 |
#define | LE_ALWAYS_VISIBLE 0x0002 |
#define | LE_LOCKED 0x0004 |
#define | LE_REMOVE_NEXT_FRAME 0x0008 |
#define | LE_INVISIBLE 0x0010 |
#define | LE_SELECTED 0x0020 |
#define | MAX_LOCALMODELS 1024 |
#define | LE_IsStunned(le) (((le)->state & STATE_STUN) & ~STATE_DEAD) |
#define | LE_IsDead(le) ((le)->state & STATE_DEAD) |
#define | LE_IsPanicked(le) ((le)->state & STATE_PANIC) |
#define | LE_IsRaged(le) ((le)->state & STATE_RAGE) |
#define | LE_IsInsane(le) ((le)->state & STATE_INSANE) |
#define | LE_IsShaken(le) ((le)->state & STATE_SHAKEN) |
#define | LE_IsCrouched(le) ((le)->state & STATE_CROUCHED) |
#define | LE_IsDazed(le) ((le)->state & STATE_DAZED) |
#define | LE_IsInvisible(le) ((le)->flags & LE_INVISIBLE) |
#define | LE_IsSelected(le) ((le)->flags & LE_SELECTED) |
#define | LE_SetInvisible(le) do { if (cl_leshowinvis->integer) le->flags &= ~LE_INVISIBLE; else le->flags |= LE_INVISIBLE; } while (0) |
#define | LE_IsItem(le) ((le)->type == ET_ITEM) |
#define | LE_IsCamera(le) ((le)->type == ET_CAMERA) |
#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_IsRotating(le) ((le)->type == ET_ROTATING) |
#define | LE_IsDoor(le) ((le)->type == ET_DOOR || (le)->type == ET_DOOR_SLIDING) |
#define | LE_IsBreakable(le) ((le)->type == ET_BREAKABLE) |
#define | LE_IsBrushModel(le) (LE_IsBreakable(le) || LE_IsDoor(le) || LE_IsRotating(le)) |
#define | LE_IsNotSolid(le) ((le)->type == ET_TRIGGER_RESCUE || (le)->type == ET_TRIGGER_NEXTMAP) |
#define | LE_GetAnimationIndexForDeath(le) ((le)->state & MAX_DEATH) |
Valid indices from 1 - MAX_DEATH. More... | |
#define | LE_NotFoundError(entnum) _LE_NotFoundError(entnum, -1, __FILE__, __LINE__) |
#define | LE_NotFoundWithTypeError(entnum, type) _LE_NotFoundError(entnum, type, __FILE__, __LINE__) |
Typedefs | |
typedef bool(* | localEntitiyAddFunc_t )(struct le_s *le, entity_t *ent) |
typedef void(* | localEntityThinkFunc_t )(struct le_s *le) |
typedef struct leStep_s | leStep_t |
typedef struct le_s | le_t |
a local entity More... | |
typedef struct localModel_s | localModel_t |
local models More... | |
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. More... | |
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. More... | |
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, localEntityThinkFunc_t think) |
void | LE_ExecuteThink (le_t *le) |
Call think function for the given local entity if its still in use. More... | |
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. More... | |
void | LET_StartIdle (le_t *le) |
Change the animation of an actor to the idle animation (which can be panic, dead or stand) More... | |
void | LET_Appear (le_t *le) |
void | LET_StartPathMove (le_t *le) |
Change the actors animation to walking. More... | |
void | LET_HiddenMove (le_t *le) |
Handle move for invisible actors. More... | |
void | LET_BrushModel (le_t *le) |
void | LE_DoEndPathMove (le_t *le) |
Ends the move of an actor. More... | |
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(). More... | |
void | LM_Perish (dbuffer *msg) |
void | LM_AddToScene (void) |
Add the local models to the scene. More... | |
bool | LE_BrushModelAction (le_t *le, entity_t *ent) |
Add function for brush models. More... | |
void | CL_RecalcRouting (const le_t *le) |
void | CL_CompleteRecalcRouting (void) |
void | LE_LinkFloorContainer (le_t *le) |
link any floor container into the actor temp floor container More... | |
bool | LE_IsLivingAndVisibleActor (const le_t *le) |
Checks whether the given le is a living and visible actor. More... | |
bool | LE_IsLivingActor (const le_t *le) |
Checks whether the given le is a living actor (but might be hidden) More... | |
bool | LE_IsActor (const le_t *le) |
Checks whether the given le is a living actor. More... | |
le_t * | LE_Add (int entnum) |
Add a new local entity to the scene. More... | |
le_t * | LE_Get (int entnum) |
Searches all local entities for the one with the searched entnum. More... | |
le_t * | LE_GetNextInUse (le_t *lastLE) |
Iterate through the entities that are in use. More... | |
le_t * | LE_GetNext (le_t *lastLE) |
Iterate through the list of entities. More... | |
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. More... | |
void | LE_Unlock (le_t *le) |
Unlocks a previously locked le_t struct. More... | |
bool | LE_IsLocked (int entnum) |
Checks if a given le_t structure is locked, i.e., used by another event at this time. More... | |
void | _LE_NotFoundError (int entnum, int type, const char *file, const int line) __attribute__((noreturn)) |
le_t * | LE_Find (entity_type_t type, const pos3_t pos) |
Searches a local entity on a given grid field. More... | |
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. More... | |
le_t * | LE_GetFromPos (const pos3_t pos) |
Searches a local entity on a given grid field. More... | |
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. More... | |
void | LE_AddToScene (void) |
void | LE_CenterView (const le_t *le) |
Center the camera on the local entity's origin. More... | |
const cBspModel_t * | LE_GetClipModel (const le_t *le) |
model_t * | LE_GetDrawModel (unsigned int modelIndex) |
void | LET_SlideDoor (le_t *le, int speed) |
Slides a door. More... | |
void | LET_RotateDoor (le_t *le, int speed) |
Rotates a door in the given speed. More... | |
trace_t | CL_Trace (const Line &traceLine, const AABB &box, const le_t *passle, le_t *passle2, int contentmask, int worldLevel) |
Moves the given mins/maxs volume through the world from start to end. More... | |
void | LM_Register (void) |
Register misc_models. More... | |
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_trace_debug |
cvar_t * | cl_leshowinvis |
cvar_t * | cl_map_draw_rescue_zone |
#define IS_MODE_FIRE_HEADGEAR | ( | x | ) | ((x) == M_FIRE_HEADGEAR) |
Definition at line 42 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 41 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 43 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 40 of file cl_localentity.h.
Referenced by CL_ActorFireModeActivated(), and CL_ActorShoot().
#define LE_ALWAYS_VISIBLE 0x0002 |
Definition at line 49 of file cl_localentity.h.
Referenced by LE_AddToScene().
#define LE_CHECK_LEVELFLAGS 0x0001 |
Definition at line 48 of file cl_localentity.h.
Referenced by CL_AddBrushModel(), CL_CameraAppear(), and LE_AddToScene().
#define LE_GetAnimationIndexForDeath | ( | le | ) | ((le)->state & MAX_DEATH) |
Valid indices from 1 - MAX_DEATH.
Definition at line 283 of file cl_localentity.h.
Referenced by CL_ActorDie(), and LET_StartIdle().
#define LE_INVISIBLE 0x0010 |
Definition at line 54 of file cl_localentity.h.
Referenced by CL_ActorAdd(), CL_ActorAppear(), and CL_EntPerish().
#define LE_IsAlien | ( | le | ) | ((le)->team == TEAM_ALIEN) |
Definition at line 274 of file cl_localentity.h.
Referenced by CL_AddTargetingBox(), and GAME_CollectAliens().
#define LE_IsBreakable | ( | le | ) | ((le)->type == ET_BREAKABLE) |
Definition at line 278 of file cl_localentity.h.
Referenced by CL_SoundEvent().
#define LE_IsBrushModel | ( | le | ) | (LE_IsBreakable(le) || LE_IsDoor(le) || LE_IsRotating(le)) |
Definition at line 279 of file cl_localentity.h.
Definition at line 272 of file cl_localentity.h.
#define LE_IsCivilian | ( | le | ) | ((le)->team == TEAM_CIVILIAN) |
Definition at line 273 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 263 of file cl_localentity.h.
Referenced by CL_ActorDoMoveTime(), CL_ActorMaximumMove(), CL_ActorMoveLength(), CL_ActorMoveMode(), CL_ActorStandCrouch_f(), CL_ActorStateChange(), CL_ActorTraceMove(), CL_ActorVis(), CL_DrawLineOfSight(), CL_GetHitProbability(), CL_TargetingGrenade(), CL_TargetingStraight(), HUD_UpdateButtons(), HUD_UpdateCursor(), LE_DoPathMove(), and LE_PlaySoundFileForContents().
#define LE_IsDazed | ( | le | ) | ((le)->state & STATE_DAZED) |
Definition at line 264 of file cl_localentity.h.
Referenced by CL_ActorStateChange().
#define LE_IsDead | ( | le | ) | ((le)->state & STATE_DEAD) |
Definition at line 258 of file cl_localentity.h.
Referenced by CL_ActorAddToTeamList(), CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorSelect(), CL_ActorSelectNext(), CL_ActorSelectPrev(), CL_ActorVis(), CL_ActorWound(), CL_AddActor(), CL_AddUGV(), GAME_CollectAliens(), GAME_CollectItems(), HUD_UpdateActorStats(), LE_IsLivingActor(), LET_StartIdle(), UI_RadarNodeDrawActor(), and UI_RadarNodeGetActorColor().
#define LE_IsDoor | ( | le | ) | ((le)->type == ET_DOOR || (le)->type == ET_DOOR_SLIDING) |
Definition at line 277 of file cl_localentity.h.
Referenced by CL_ActorUse_f(), and CL_SoundEvent().
#define LE_IsInsane | ( | le | ) | ((le)->state & STATE_INSANE) |
Definition at line 261 of file cl_localentity.h.
#define LE_IsInvisible | ( | le | ) | ((le)->flags & LE_INVISIBLE) |
Definition at line 266 of file cl_localentity.h.
Referenced by CL_ActorDoMove(), CL_BuildForbiddenList(), CL_GetHitProbability(), CL_TargetingGrenade(), CL_TargetingStraight(), uiRadarNode::draw(), LE_AddToScene(), LE_IsLivingAndVisibleActor(), and LET_StartIdle().
Definition at line 271 of file cl_localentity.h.
Referenced by CL_InvAdd(), CL_InvDel(), GAME_CollectItems(), LE_Cleanup(), and LE_PlaceItem().
#define LE_IsNotSolid | ( | le | ) | ((le)->type == ET_TRIGGER_RESCUE || (le)->type == ET_TRIGGER_NEXTMAP) |
Definition at line 280 of file cl_localentity.h.
Referenced by CL_AddBrushModel().
#define LE_IsPanicked | ( | le | ) | ((le)->state & STATE_PANIC) |
Definition at line 259 of file cl_localentity.h.
Referenced by CL_ActorStateChange(), HUD_UpdateActor(), and LET_StartIdle().
#define LE_IsPhalanx | ( | le | ) | ((le)->team == TEAM_PHALANX) |
Definition at line 275 of file cl_localentity.h.
#define LE_IsRaged | ( | le | ) | ((le)->state & STATE_RAGE) |
Definition at line 260 of file cl_localentity.h.
Referenced by CL_ActorStateChange().
#define LE_IsRotating | ( | le | ) | ((le)->type == ET_ROTATING) |
Definition at line 276 of file cl_localentity.h.
#define LE_IsSelected | ( | le | ) | ((le)->flags & LE_SELECTED) |
Definition at line 267 of file cl_localentity.h.
Referenced by CL_ActorConditionalMoveCalc(), CL_ActorDoShoot(), CL_ActorRemoveFromTeamList(), CL_ActorSelect(), CL_ActorSelectMouse(), CL_ActorSelectNext(), CL_ActorSelectPrev(), CL_ActorStats(), CL_AddActor(), CL_AddTargetingBox(), CL_AddUGV(), CL_GetHitProbability(), CL_InvAdd(), HUD_DisplayImpossibleReaction(), HUD_DisplayPossibleReaction(), LE_AddToScene(), LE_DoEndPathMove(), and UI_RadarNodeDrawActor().
#define LE_IsShaken | ( | le | ) | ((le)->state & STATE_SHAKEN) |
Definition at line 262 of file cl_localentity.h.
Referenced by CL_ActorStateChange().
#define LE_IsStunned | ( | le | ) | (((le)->state & STATE_STUN) & ~STATE_DEAD) |
Definition at line 256 of file cl_localentity.h.
Referenced by CL_ActorAppear(), CL_ActorConfirmAction_f(), CL_ActorDie(), CL_ActorRemoveFromTeamList(), CL_ActorRevitalised(), CL_ActorStartShoot(), CL_AddActor(), CL_BattlescapeSearchAtGridPos(), CL_BuildForbiddenList(), GAME_CollectAliens(), LE_IsLivingActor(), and LE_PlaySoundFileAndParticleForSurface().
#define LE_LOCKED 0x0004 |
if there is an event going on involving this le_t. Used to limit to one event per le_t struct at any time.
Definition at line 50 of file cl_localentity.h.
Referenced by LE_IsLocked(), LE_Lock(), and LE_Unlock().
#define LE_NotFoundError | ( | entnum | ) | _LE_NotFoundError(entnum, -1, __FILE__, __LINE__) |
Definition at line 323 of file cl_localentity.h.
Referenced by CL_ActorAppear(), CL_ActorClientAction(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorReactionFireAbortShot(), CL_ActorReactionFireAbortShotTime(), CL_ActorReactionFireAddTarget(), CL_ActorReactionFireAddTargetTime(), CL_ActorReactionFireChange(), CL_ActorReactionFireRemoveTarget(), CL_ActorReactionFireRemoveTargetTime(), CL_ActorReactionFireTargetUpdate(), CL_ActorReactionFireTargetUpdateTime(), CL_ActorReservationChange(), CL_ActorResetClientAction(), CL_ActorRevitalised(), CL_ActorShootHidden(), CL_ActorStateChange(), CL_ActorStats(), CL_ActorWound(), CL_DoorClose(), CL_DoorOpen(), CL_Explode(), CL_InvAdd(), CL_ParticleAppear(), and CL_SoundEventTime().
#define LE_NotFoundWithTypeError | ( | entnum, | |
type | |||
) | _LE_NotFoundError(entnum, type, __FILE__, __LINE__) |
Definition at line 324 of file cl_localentity.h.
Referenced by CL_EntPerish().
#define LE_REMOVE_NEXT_FRAME 0x0008 |
will set the inuse value to false in the next frame
Definition at line 53 of file cl_localentity.h.
Referenced by CL_InvAdd(), LE_AddToScene(), and LE_PlaceItem().
#define LE_SELECTED 0x0020 |
used for actors - for the current selected actor this is true
Definition at line 55 of file cl_localentity.h.
Referenced by CL_ActorSelect().
#define LE_SetInvisible | ( | le | ) | do { if (cl_leshowinvis->integer) le->flags &= ~LE_INVISIBLE; else le->flags |= LE_INVISIBLE; } while (0) |
Definition at line 269 of file cl_localentity.h.
Referenced by CL_EntAppear(), CL_ParticleAppear(), LE_AddAmbientSound(), LE_AddGrenade(), and LE_AddProjectile().
#define MAX_LOCALMODELS 1024 |
Definition at line 204 of file cl_localentity.h.
Referenced by LM_AddModel().
Definition at line 45 of file cl_localentity.h.
Definition at line 46 of file cl_localentity.h.
typedef struct localModel_s localModel_t |
local models
enum actorModes_t |
Actor actions.
Definition at line 30 of file cl_localentity.h.
Definition at line 1239 of file cl_localentity.cpp.
References Cmd_ExecuteString(), Com_Error(), and ERR_DROP.
Definition at line 128 of file cl_localentity.cpp.
References cl, CL_GridRecalcRouting(), Com_Printf(), i, LE_GenerateInlineModelList(), clientBattleScape_s::LEs, and clientBattleScape_s::numLEs.
Referenced by CL_Reset().
[in] | le | A local entity of a brush model (func_breakable, func_door, ...) |
Definition at line 145 of file cl_localentity.cpp.
References CL_ActorConditionalMoveCalc(), CL_GridRecalcRouting(), LE_GenerateInlineModelList(), and selActor.
Referenced by CL_AddBrushModel(), CL_Explode(), LET_RotateDoor(), and LET_SlideDoor().
trace_t CL_Trace | ( | const Line & | traceLine, |
const AABB & | box, | ||
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] | traceLine | Start and end vector of the trace |
[in] | box | The box we move through the world |
[in] | passle | Ignore this local entity in the trace (might be nullptr) |
[in] | passle2 | Ignore this local entity in the trace (might be nullptr) |
[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 1739 of file cl_localentity.cpp.
References MoveClip::calcBounds(), cl, CL_ClipMoveToLEs(), CM_CompleteBoxTrace(), MoveClip::contentmask, trace_s::fraction, cvar_s::integer, trace_s::le, clientBattleScape_s::mapTiles, MoveClip::moveLine, MoveClip::objBox, MoveClipCL::passle, MoveClipCL::passle2, R_DrawBoundingBoxBatched(), Line::set(), AABB::set(), and MoveClipCL::trace.
Referenced by CL_ActorVis(), CL_TargetingGrenade(), CL_TargetingStraight(), LE_PlayFootStepSound(), PTL_Trace(), and Weather::update().
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 570 of file cl_localentity.cpp.
References BASE_DIRECTIONS, cl, CORE_DIRECTIONS, dest, DIRECTION_FALL, le_s::fieldSize, Grid_PosToVec(), clientBattleScape_s::mapData, mapData_s::routing, and UNIT_SIZE.
Referenced by CL_ActorDoMoveTime(), and LE_DoPathMove().
Add a new local entity to the scene.
[in] | entnum | The entity number (server side) |
Definition at line 1209 of file cl_localentity.cpp.
References ACTOR_SIZE_NORMAL, cl, Com_Error(), le_s::entnum, ERR_DROP, le_s::fieldSize, le_s::init(), le_s::inuse, LE_GetNext(), clientBattleScape_s::LEs, MAX_EDICTS, and clientBattleScape_s::numLEs.
Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_AddBrushModel(), CL_AddEdict(), CL_CameraAppear(), 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 1169 of file cl_localentity.cpp.
References le_s::attenuation, Com_DPrintf(), Com_Printf(), DEBUG_SOUND, ET_SOUND, f, LE_Add(), LE_SetInvisible, le_s::levelflags, le_s::origin, S_LoadSampleIdx(), le_s::sampleIdx, 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 |
[in] | leVictim | The actor the grenade is thrown at (not yet supported) |
Definition at line 940 of file cl_localentity.cpp.
References le_s::angle, ptl_s::angles, fireDef_s::bounce, fireDef_s::bounceSound, cl, CL_ParticleSpawn(), crand(), le_s::endTime, le_s::fd, GRAVITY, fireDef_s::hitBody, fireDef_s::hitBodySound, fireDef_s::impact, fireDef_s::impactSound, le_s::inuse, LE_Add(), LE_ExecuteThink(), LE_SetInvisible, LE_SetThink(), LET_Projectile(), ptl_s::omega, fireDef_s::projectile, le_s::ptl, le_s::ref1, le_s::ref2, le_s::ref3, SF_BODY, SF_BOUNCING, SF_IMPACT, fireDef_s::splrad, clientBattleScape_s::time, 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 784 of file cl_localentity.cpp.
References le_s::angle, ptl_s::angles, fireDef_s::bounce, fireDef_s::bounceSound, bytedirs, cl, CL_ActorPlaySound(), CL_ParticleSpawn(), csi, fireDef_s::damage, csi_s::damStunGas, objDef_s::dmgtype, le_s::endTime, le_s::fd, fireDef_s::hitBody, fireDef_s::hitBodySound, fireDef_s::impact, fireDef_s::impactAttenuation, fireDef_s::impactSound, le_s::inuse, LE_ActorBodyHit(), LE_Add(), LE_ExecuteThink(), LE_SetInvisible, LE_SetThink(), LET_Projectile(), fireDef_s::obj, le_s::origin, fireDef_s::projectile, le_s::ptl, le_s::ref1, le_s::ref2, le_s::ref3, ptl_s::s, S_LoadAndPlaySample(), SF_BODY, SF_BOUNCING, SF_IMPACT, ptl_s::size, SND_HURT, SND_VOLUME_WEAPONS, fireDef_s::speed, fireDef_s::splrad, clientBattleScape_s::time, ptl_s::v, VecToAngles(), VectorLength(), VectorMA(), VectorScale, and VectorSubtract.
Referenced by CL_ActorDoShoot().
Definition at line 1486 of file cl_localentity.cpp.
References le_s::addFunc, le_s::alpha, le_s::angles, le_s::as, le_s::bodySkin, cl, CL_ParticleSpawn(), cl_worldlevel, le_s::clientAction, le_s::contents, CONTENTS_DETAIL, CONTENTS_SOLID, ET_MAX, ET_NULL, le_s::flags, i, cvar_s::integer, le_s::inuse, LE_AddEdictHighlight(), LE_ALWAYS_VISIBLE, LE_CHECK_LEVELFLAGS, LE_IsInvisible, LE_IsOriginBrush(), LE_IsSelected, LE_REMOVE_NEXT_FRAME, clientBattleScape_s::LEs, le_s::levelflags, le_s::lighting, le_s::model1, clientBattleScape_s::numLEs, le_s::origin, le_s::pos, R_AddEntity(), R_EntitySetOrigin(), RF_NONE, le_s::type, and VectorCopy.
Referenced by CL_ViewRender().
Add function for brush models.
Definition at line 986 of file cl_localentity.cpp.
References le_s::aabb, le_s::angles, cl_worldlevel, ET_BREAKABLE, ET_DOOR, ET_DOOR_SLIDING, ET_ROTATING, ET_TRIGGER_RESCUE, AABB::getMaxX(), AABB::getMaxY(), AABB::getMinX(), AABB::getMinY(), AABB::getMinZ(), cvar_s::integer, le_s::levelflags, entity_t::origin, le_s::origin, R_AddEntity(), R_FindPics(), RF_BOX, RF_PATH, AABB::set(), le_s::type, UNIT_SIZE, VectorCopy, and VectorSet.
Referenced by CL_AddBrushModel().
Center the camera on the local entity's origin.
le | The local entity which origin is used to center the camera |
Definition at line 1257 of file cl_localentity.cpp.
References clientBattleScape_s::cam, cl, cl_centerview, CL_CheckCameraRoute(), cls, Cvar_SetValue(), cvar_s::integer, camera_s::origin, le_s::origin, le_s::pos, client_static_s::team, le_s::team, UNIT_SIZE, VecToPos, Vector2Dist, and VectorCopy.
Referenced by CL_ActorAppear(), CL_ActorReactionFireAddTarget(), CL_ActorSelectList(), CL_EntPerish(), and LET_StartPathMove().
Cleanup unused LE inventories that the server sent to the client also free some unused LE memory.
Definition at line 1557 of file cl_localentity.cpp.
References CID_FLOOR, cl, CL_ActorCleanup(), cls, Com_DPrintf(), DEBUG_CLIENT, InventoryInterface::emptyContainer(), client_static_s::i, i, le_s::inuse, le_s::inv, LE_IsActor(), LE_IsItem, clientBattleScape_s::LEs, and clientBattleScape_s::numLEs.
Referenced by CL_ClearState().
Ends the move of an actor.
Definition at line 636 of file cl_localentity.cpp.
References CL_ActorConditionalMoveCalc(), Com_Error(), ERR_DROP, LE_ExecuteThink(), LE_IsSelected, LE_LinkFloorContainer(), LE_SetThink(), LE_Unlock(), LET_StartIdle(), le_s::newPos, le_s::pathLength, le_s::pathPos, le_s::pos, selActor, le_s::team, and VectorCompare.
Referenced by CL_ActorDoMove(), and LET_PathMove().
Call think function for the given local entity if its still in use.
Definition at line 371 of file cl_localentity.cpp.
References le_s::inuse, and le_s::think.
Referenced by LE_AddGrenade(), LE_AddProjectile(), LE_DoEndPathMove(), LE_Think(), LET_HiddenMove(), and LET_StartPathMove().
le_t* LE_Find | ( | entity_type_t | type, |
const pos3_t | pos | ||
) |
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 1441 of file cl_localentity.cpp.
References LE_GetNextInUse(), le_s::pos, le_s::type, and VectorCompare.
Referenced by CL_ActorRevitalised(), and LE_LinkFloorContainer().
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. nullptr 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 1416 of file cl_localentity.cpp.
References le_s::aabb, ET_NULL, AABB::getCenter(), LE_GetNextInUse(), le_s::origin, le_s::type, and VectorLength().
Searches all local entities for the one with the searched entnum.
[in] | entnum | The entity number (server side) |
Definition at line 1287 of file cl_localentity.cpp.
References le_s::entnum, LE_GetNextInUse(), and SKIP_LOCAL_ENTITY.
Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_ActorClientAction(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorEndShoot(), CL_ActorReactionFireAbortShot(), CL_ActorReactionFireAbortShotTime(), CL_ActorReactionFireAddTarget(), CL_ActorReactionFireAddTargetTime(), CL_ActorReactionFireChange(), CL_ActorReactionFireRemoveTarget(), CL_ActorReactionFireRemoveTargetTime(), CL_ActorReactionFireTargetUpdate(), CL_ActorReactionFireTargetUpdateTime(), CL_ActorReservationChange(), CL_ActorResetClientAction(), CL_ActorRevitalised(), CL_ActorShootHidden(), CL_ActorStartShoot(), CL_ActorStateChange(), CL_ActorStats(), CL_ActorWound(), CL_AddBrushModel(), CL_AddEdict(), CL_CameraAppear(), CL_DoorClose(), CL_DoorOpen(), CL_EntAppear(), CL_EntDestroy(), CL_EntPerish(), CL_Explode(), CL_InvAdd(), CL_InvAmmo(), CL_InvDel(), CL_InvReload(), CL_ParticleAppear(), CL_SoundEvent(), CL_SoundEventTime(), and LE_IsLocked().
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 (crouched animations) have a 'c' in front of their animation definitions (see *.anm files for characters) |
Definition at line 423 of file cl_localentity.cpp.
References objDef_s::animationIndex, Com_sprintf(), INVSH_GetItemByIDX(), length, MAX_VAR, NONE, Q_streq, Q_strstart(), STATE_CROUCHED, type, and objDef_s::type.
Referenced by CL_ActorDoShoot(), CL_ActorStartShoot(), LET_StartIdle(), and LET_StartPathMove().
const cBspModel_t* LE_GetClipModel | ( | const le_t * | le | ) |
Definition at line 1625 of file cl_localentity.cpp.
References cl, Com_Error(), ERR_DROP, index, lengthof, clientBattleScape_s::model_clip, and le_s::modelnum1.
Referenced by CL_AddBrushModel(), CL_HullForEntity(), and LE_AddEdictHighlight().
Definition at line 1637 of file cl_localentity.cpp.
References cl, Com_Error(), ERR_DROP, index, lengthof, and clientBattleScape_s::model_draw.
Referenced by CL_ActorAppear(), and CL_ViewLoadMedia().
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 1353 of file cl_localentity.cpp.
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 nullptr, we start at the beginning |
Definition at line 1370 of file cl_localentity.cpp.
References cl, clientBattleScape_s::LEs, and clientBattleScape_s::numLEs.
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 nullptr, we start at the beginning |
Definition at line 1398 of file cl_localentity.cpp.
References le_s::inuse, and LE_GetNext().
Referenced by CL_ActorConfirmAction_f(), CL_ActorGetClosest(), CL_BattlescapeSearchAtGridPos(), CL_BuildForbiddenList(), CL_ClipMoveToLEs(), CL_CountVisibleEnemies(), CL_EntPerish(), CL_NotifyBattlescapeEventDelay(), CL_ViewLoadMedia(), uiRadarNode::draw(), GAME_CollectAliens(), GAME_CollectItems(), LE_Find(), LE_FindRadius(), LE_GenerateInlineModelList(), LE_Get(), LE_GetFromPos(), LE_PlaceItem(), and S_Frame().
bool LE_IsActor | ( | const le_t * | le | ) |
Checks whether the given le is a living actor.
[in] | le | The local entity to perform the check for |
Definition at line 253 of file cl_localentity.cpp.
References ET_ACTOR, ET_ACTOR2x2, ET_ACTORHIDDEN, and le_s::type.
Referenced by CL_ActorDoMove(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorInvMove(), CL_ActorMouseTrace(), CL_ActorStateChange(), GAME_CollectAliens(), GAME_CollectItems(), LE_Cleanup(), and LE_IsLivingActor().
bool LE_IsLivingActor | ( | const le_t * | le | ) |
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 265 of file cl_localentity.cpp.
References LE_IsActor(), LE_IsDead, and LE_IsStunned.
Referenced by CL_ActorAppear(), CL_ActorConfirmAction_f(), CL_ActorDie(), CL_ActorRevitalised(), CL_ActorStartShoot(), CL_ActorStateChange(), CL_NotifyBattlescapeEventDelay(), CL_SoundEvent(), and LE_IsLivingAndVisibleActor().
bool LE_IsLivingAndVisibleActor | ( | const le_t * | le | ) |
Checks whether the given le is a living and visible actor.
[in] | le | The local entity to perform the check for |
Definition at line 277 of file cl_localentity.cpp.
References ET_ACTORHIDDEN, LE_IsInvisible, LE_IsLivingActor(), and le_s::type.
Referenced by CL_ActorGetClosest(), CL_BattlescapeSearchAtGridPos(), CL_BuildForbiddenList(), CL_CountVisibleEnemies(), CL_NextAlien_f(), CL_NextAlienVisibleFromActor_f(), CL_PrevAlien_f(), and LE_PlaySoundFileAndParticleForSurface().
bool 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 1309 of file cl_localentity.cpp.
References le_s::flags, LE_Get(), and LE_LOCKED.
Referenced by CL_CheckDefault().
link any floor container into the actor temp floor container
Definition at line 239 of file cl_localentity.cpp.
References ET_ITEM, LE_Find(), le_s::pos, le_s::resetFloor(), and le_s::setFloor().
Referenced by LE_DoEndPathMove().
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 1322 of file cl_localentity.cpp.
References Com_Error(), le_s::entnum, ERR_DROP, le_s::flags, and LE_LOCKED.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), and CL_ActorRevitalised().
[in] | le | The local entity (ET_ITEM) with the floor container |
Definition at line 896 of file cl_localentity.cpp.
References le_s::angles, objDef_s::center, cl, cls, Com_Error(), ERR_DROP, ET_ACTOR, ET_ACTOR2x2, le_s::fieldSize, le_s::flags, le_s::getFloorContainer(), Grid_PosToVec(), GROUND_DELTA, objDef_s::id, objDef_s::idx, LE_BiggestItem(), LE_GetNextInUse(), LE_IsItem, LE_REMOVE_NEXT_FRAME, clientBattleScape_s::mapData, le_s::model1, client_static_s::modelPool, le_s::origin, le_s::pos, ROLL, mapData_s::routing, le_s::setFloor(), le_s::type, VectorCompare, and VectorSubtract.
Referenced by CL_InvAdd(), and CL_InvDel().
void LE_SetThink | ( | le_t * | le, |
localEntityThinkFunc_t | think | ||
) |
Definition at line 310 of file cl_localentity.cpp.
References le_s::think.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorEndShoot(), CL_ActorRevitalised(), CL_ActorStateChange(), CL_AddBrushModel(), CL_DoorClose(), CL_DoorOpen(), CL_InvAdd(), CL_InvDel(), LE_AddGrenade(), LE_AddProjectile(), LE_DoEndPathMove(), LET_HiddenMove(), LET_RotateDoor(), LET_SlideDoor(), LET_StartIdle(), and LET_StartPathMove().
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 387 of file cl_localentity.cpp.
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().
Unlocks a previously locked le_t struct.
le | The le_t to unlock. |
Definition at line 1341 of file cl_localentity.cpp.
References Com_Error(), le_s::entnum, ERR_DROP, le_s::flags, and LE_LOCKED.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorRevitalised(), LE_DoEndPathMove(), and LET_HiddenMove().
Definition at line 1047 of file cl_localentity.cpp.
References le_s::angle, le_s::angles, cl, ET_ROTATING, le_s::rotationSpeed, le_s::thinkDelay, clientBattleScape_s::time, and le_s::type.
Referenced by CL_AddBrushModel().
Handle move for invisible actors.
Definition at line 737 of file cl_localentity.cpp.
References LE_ExecuteThink(), LE_SetThink(), LE_Unlock(), LET_StartIdle(), le_s::newPos, le_s::pos, and VectorCopy.
Referenced by CL_ActorDoMove().
Rotates a door in the given speed.
[in] | le | The local entity of the door to rotate |
[in] | speed | The speed to rotate the door with |
Definition at line 1081 of file cl_localentity.cpp.
References le_s::angles, cl, CL_RecalcRouting(), CM_SetInlineModelOrientation(), le_s::dir, DOOR_OPEN_REVERSE, DOOR_ROTATION_ANGLE, le_s::inlineModelName, LE_SetThink(), clientBattleScape_s::mapTiles, and le_s::origin.
Referenced by LET_DoorRotatingClose(), and LET_DoorRotatingOpen().
Slides a door.
[in,out] | le | The local entity of the inline model |
[in] | speed | The speed to slide with - a negative value to close the door |
Definition at line 1110 of file cl_localentity.cpp.
References AngleVectors(), cBspModel_s::cbmBox, cl, CL_RecalcRouting(), CM_InlineModel(), le_s::dir, DotProduct, GET_SLIDING_DOOR_SHIFT_VECTOR, le_s::inlineModelName, LE_SetThink(), clientBattleScape_s::mapTiles, le_s::origin, AABB::shift(), le_s::size, le_s::thinkDelay, VectorAdd, VectorEmpty, and VectorMul.
Referenced by LET_DoorSlidingClose(), and LET_DoorSlidingOpen().
Change the animation of an actor to the idle animation (which can be panic, dead or stand)
Definition at line 478 of file cl_localentity.cpp.
References le_s::as, Com_Error(), le_s::entnum, ERR_DROP, LE_GetAnim(), LE_GetAnimationIndexForDeath, LE_IsDead, LE_IsInvisible, LE_IsPanicked, LE_SetThink(), le_s::left, Mem_Free, le_s::model1, leStep_s::next, le_s::pathLength, le_s::pathPos, R_AnimChange(), le_s::right, le_s::state, le_s::stepIndex, le_s::stepList, and va().
Referenced by CL_ActorAppear(), CL_ActorEndShoot(), CL_ActorRevitalised(), CL_ActorStateChange(), CL_InvAdd(), CL_InvDel(), LE_DoEndPathMove(), and LET_HiddenMove().
Change the actors animation to walking.
Definition at line 716 of file cl_localentity.cpp.
References le_s::as, animState_s::change, cls, Com_Printf(), le_s::entnum, client_static_s::isOurRound(), LE_CenterView(), 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, le_s::team, and TEAM_CIVILIAN.
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 341 of file cl_localentity.cpp.
References localModel_s::angles, cl, Com_Error(), localModel_s::entnum, ERR_DROP, localModel_s::inuse, localModel_s::levelflags, LM_Find(), clientBattleScape_s::LMs, MAX_LOCALMODELS, localModel_s::name, clientBattleScape_s::numLMs, OBJZERO, localModel_s::origin, Q_strncpyz(), localModel_s::renderFlags, localModel_s::setScale(), and VectorCopy.
Referenced by SP_misc_model().
Add the local models to the scene.
Definition at line 218 of file cl_localentity.cpp.
References LM_AddToSceneOrder().
Referenced by CL_ViewRender().
localModel_t* LM_GetByID | ( | const char * | id | ) |
Definition at line 315 of file cl_localentity.cpp.
References cl, i, localModel_s::id, clientBattleScape_s::LMs, clientBattleScape_s::numLMs, Q_streq, and Q_strnull().
Referenced by LMT_Init(), and SP_misc_model().
Register misc_models.
Definition at line 292 of file cl_localentity.cpp.
References localModel_s::animname, localModel_s::as, animState_s::change, cl, Com_Printf(), i, localModel_s::inuse, clientBattleScape_s::LMs, localModel_s::model, localModel_s::name, clientBattleScape_s::numLMs, R_AnimChange(), and R_FindModel().
Referenced by CL_ViewLoadMedia().
Definition at line 400 of file cl_localentity.cpp.
References cl, i, clientBattleScape_s::LMs, clientBattleScape_s::numLMs, and localModel_s::think.
Referenced by CL_SpawnParseEntitystring().
void LMT_Init | ( | localModel_t * | localModel | ) |
Definition at line 1063 of file cl_localentity.cpp.
References Com_Error(), ERR_DROP, LM_GetByID(), localModel_s::parent, localModel_s::target, and localModel_s::think.
Referenced by SP_misc_model().
cvar_t* cl_le_debug |
Definition at line 39 of file cl_localentity.cpp.
Referenced by CL_InitLocal().
cvar_t* cl_leshowinvis |
Definition at line 72 of file cl_main.cpp.
cvar_t* cl_map_draw_rescue_zone |
Definition at line 41 of file cl_localentity.cpp.
Referenced by CL_ViewInit().
cvar_t* cl_trace_debug |
Definition at line 40 of file cl_localentity.cpp.
Referenced by CL_InitLocal().
|
static |
Definition at line 243 of file cl_localentity.h.
Referenced by CL_ActorAppear(), CL_ActorDie(), and CL_ActorStateChange().
|
static |
Definition at line 242 of file cl_localentity.h.
Referenced by CL_ActorAppear(), and CL_ActorRevitalised().
|
static |
Definition at line 241 of file cl_localentity.h.
Referenced by CL_ActorAppear().