UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cl_actor.h File Reference

Go to the source code of this file.

Macros

#define CURSOR_OFFSET   UNIT_HEIGHT * 0.4
 
#define EYE_HT_STAND   UNIT_HEIGHT * 0.25
 
#define EYE_HT_CROUCH   UNIT_HEIGHT * 0.06
 
#define ACTOR_GET_FIELDSIZE(actor)   ((actor != nullptr) ? (actor)->fieldSize : ACTOR_SIZE_NORMAL)
 

Enumerations

enum  walkType_t {
  WALKTYPE_AUTOSTAND_BUT_NOT_FAR_ENOUGH, WALKTYPE_AUTOSTAND_BEING_USED, WALKTYPE_WALKING, WALKTYPE_CROUCH_WALKING,
  WALKTYPE_MAX
}
 

Functions

void MSG_Write_PA (player_action_t player_action, int num,...)
 Writes player action with its data. More...
 
void ACTOR_InitStartup (void)
 
int CL_ActorCheckAction (const le_t *le)
 Checks that an action is valid. More...
 
void CL_ActorInvMove (const le_t *le, containerIndex_t fromContainer, int fromX, int fromY, containerIndex_t toContainer, int toX, int toY)
 Sends an inventory move event to the server. More...
 
le_tCL_ActorGetFromCharacter (const character_t *chr)
 Returns the local entity information for a character in the team list. More...
 
character_tCL_ActorGetChr (const le_t *le)
 Returns the character information for an actor in the teamlist. More...
 
int CL_ActorUsableTUs (const le_t *le)
 Returns the amount of usable (overall-reserved) TUs for an actor. More...
 
int CL_ActorReservedTUs (const le_t *le, reservation_types_t type)
 Returns the amount of reserved TUs for a certain type. More...
 
void CL_ActorReserveTUs (const le_t *le, reservation_types_t type, int tus)
 Replace the reserved TUs for a certain type. More...
 
bool CL_ActorIsReactionFireOutOfRange (const le_t *shooter, const le_t *target)
 
const fireDef_tCL_ActorGetReactionFireFireDef (const le_t *shooter)
 
int CL_ActorMoveMode (const le_t *le)
 Decide how the actor will walk, taking into account autostanding. More...
 
void CL_ActorSetMode (le_t *actor, actorModes_t actorMode)
 
bool CL_ActorFireModeActivated (const actorModes_t mode)
 Checks whether we are in fire mode or node. More...
 
void CL_ActorConditionalMoveCalc (le_t *le)
 Recalculate forbidden list, available moves and actor's move length for the current selected actor. More...
 
le_tCL_ActorGetClosest (const vec3_t origin, int team)
 Returns the actor that is closest to the given origin. More...
 
bool CL_ActorSelect (le_t *le)
 Selects an actor. More...
 
bool CL_ActorSelectList (int num)
 Selects an actor from a list. More...
 
bool CL_ActorSelectNext (void)
 selects the next actor More...
 
bool CL_ActorSelectPrev (void)
 selects the previous actor More...
 
void CL_ActorAddToTeamList (le_t *le)
 Adds the actor to the team list. More...
 
void CL_ActorRemoveFromTeamList (le_t *le)
 Removes an actor (from your team) from the team list. More...
 
void CL_ActorCleanup (le_t *le)
 
void CL_ActorSelectMouse (void)
 Selects an actor using the mouse. More...
 
void CL_ActorReload (le_t *le, containerIndex_t containerID)
 Reload weapon with actor. More...
 
void CL_ActorTurnMouse (void)
 Turns the actor around without moving. More...
 
void CL_ActorStartMove (le_t *le, const pos3_t to)
 Starts moving actor. More...
 
void CL_ActorShoot (const le_t *le, const pos3_t at)
 Shoot with actor. More...
 
int CL_ActorGetContainerForReload (Item **ic, const Inventory *inv, const objDef_t *weapon)
 Searches the clip with the least TU usage to put it into the weapon. More...
 
void CL_ActorPlaySound (const le_t *le, actorSound_t soundType)
 Plays various sounds on actor action. More...
 
float CL_ActorInjuryModifier (const le_t *le, const modifier_types_t type)
 Returns the actor injury modifier of the specified type. More...
 
int CL_ActorTimeForFireDef (const le_t *le, const fireDef_t *fd, bool reaction=false)
 Find the TUs needed for the given fireDef taking into account the actor wound penalties. More...
 
void CL_ActorActionMouse (void)
 initiates action with mouse. More...
 
void CL_ActorSetFireDef (le_t *actor, const fireDef_t *fd)
 
void CL_NextRound_f (void)
 
void CL_ResetMouseLastPos (void)
 
void CL_ActorResetMoveLength (le_t *le)
 Recalculates the currently selected Actor's move length. More...
 
bool CL_ActorMouseTrace (void)
 Battlescape cursor positioning. More...
 
void CL_GetWorldCoordsUnderMouse (vec3_t groundIntersection, vec3_t upperTracePoint, vec3_t lowerTracePoint)
 Get battlescape cell position under mouse cursor. More...
 
void CL_InitBattlescapeMouseDragging (void)
 Scroll battlescape touchscreen-style, by clicking and dragging away. More...
 
void CL_BattlescapeMouseDragging (void)
 Scroll battlescape touchscreen-style, by clicking and dragging away. More...
 
bool CL_AddActor (le_t *le, entity_t *ent)
 Adds an actor to the render entities with all it's models and items. More...
 
bool CL_AddUGV (le_t *le, entity_t *ent)
 Adds an UGV to the render entities. More...
 
int CL_ActorGetNumber (const le_t *le)
 Returns the number of the actor in the teamlist. More...
 
void CL_AddTargeting (void)
 Adds a target cursor when we render the world. More...
 
void CL_AddPathing (void)
 Adds a pathing marker to the current floor when we render the world. More...
 
void CL_AddActorPathing (void)
 Adds an actor pathing marker to the current floor when we render the world. More...
 
void CL_ActorTargetAlign_f (void)
 Targets to the ground when holding the assigned button. More...
 
void CL_DisplayFloorArrows (void)
 Useful for debugging pathfinding. More...
 
void CL_DisplayObstructionArrows (void)
 Useful for debugging pathfinding. More...
 

Variables

le_tselActor
 
pos3_t truePos
 
pos3_t mousePos
 

Macro Definition Documentation

#define ACTOR_GET_FIELDSIZE (   actor)    ((actor != nullptr) ? (actor)->fieldSize : ACTOR_SIZE_NORMAL)
#define CURSOR_OFFSET   UNIT_HEIGHT * 0.4

Definition at line 28 of file cl_actor.h.

Referenced by CL_ActorMouseTrace(), and CL_GetWorldCoordsUnderMouse().

#define EYE_HT_CROUCH   UNIT_HEIGHT * 0.06

Definition at line 32 of file cl_actor.h.

Referenced by CL_DrawLineOfSight().

#define EYE_HT_STAND   UNIT_HEIGHT * 0.25

Definition at line 30 of file cl_actor.h.

Referenced by CL_DrawLineOfSight().

Enumeration Type Documentation

enum walkType_t
See also
moveModeDescriptions
Enumerator
WALKTYPE_AUTOSTAND_BUT_NOT_FAR_ENOUGH 
WALKTYPE_AUTOSTAND_BEING_USED 
WALKTYPE_WALKING 
WALKTYPE_CROUCH_WALKING 
WALKTYPE_MAX 

Definition at line 35 of file cl_actor.h.

Function Documentation

void CL_ActorActionMouse ( void  )

initiates action with mouse.

See also
CL_ActionDown
CL_ActorStartMove

Definition at line 1266 of file cl_actor.cpp.

References le_s::actorMode, CL_ActorFireModeActivated(), CL_ActorSetMode(), IN_GetMouseSpace, M_MOVE, and MS_WORLD.

Referenced by CL_ActionUp_f(), and CL_ActorTurnMouse().

void CL_ActorAddToTeamList ( le_t le)
int CL_ActorCheckAction ( const le_t le)

Checks that an action is valid.

Parameters
[in]lePointer to actor for which we check an action.
Returns
true if action is valid.

Definition at line 713 of file cl_actor.cpp.

References _, cls, HUD_DisplayMessage(), le_s::isMoving(), and client_static_s::isOurRound().

Referenced by CL_ActorReload(), CL_ActorShoot(), CL_ActorStandCrouch_f(), CL_ActorStartMove(), CL_ActorTurnMouse(), CL_ActorUse(), CL_ActorUse_f(), CL_ActorUseHeadgear_f(), HUD_ToggleCrouchReservation_f(), and HUD_ToggleReaction_f().

void CL_ActorCleanup ( le_t le)
void CL_ActorConditionalMoveCalc ( le_t le)

Recalculate forbidden list, available moves and actor's move length for the current selected actor.

Note
An attempt to do this with le->TU to save time ended up with the first actor not being able to move at gamestart.
Todo:
seems like this function is called before the TUs are set

Definition at line 682 of file cl_actor.cpp.

References cl, CL_ActorResetMoveLength(), CL_BuildForbiddenList(), le_s::fieldSize, Grid_CalcPathing(), LE_IsSelected, clientBattleScape_s::mapData, MAX_ROUTE_TUS, clientBattleScape_s::pathMap, le_s::pos, and mapData_s::routing.

Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorRevitalised(), CL_ActorSelect(), CL_ActorStateChange(), CL_DoEndRound(), CL_RecalcRouting(), and LE_DoEndPathMove().

bool CL_ActorFireModeActivated ( const actorModes_t  mode)

Checks whether we are in fire mode or node.

Parameters
modeThe actor mode
Returns
true if we are in fire mode, false otherwise

Definition at line 1066 of file cl_actor.cpp.

References IS_MODE_FIRE_HEADGEAR, IS_MODE_FIRE_LEFT, and IS_MODE_FIRE_RIGHT.

Referenced by CL_ActorActionMouse(), CL_ActorTargetAlign_f(), CL_ActorTurnMouse(), HUD_UpdateActor(), and UI_KeyPressed().

le_t* CL_ActorGetClosest ( const vec3_t  origin,
int  team 
)

Returns the actor that is closest to the given origin.

Definition at line 694 of file cl_actor.cpp.

References LE_GetNextInUse(), LE_IsLivingAndVisibleActor(), le_s::origin, le_s::team, and VectorDist.

Referenced by CL_SoundEvent().

int CL_ActorGetContainerForReload ( Item **  ammoItem,
const Inventory inv,
const objDef_t weapon 
)

Searches the clip with the least TU usage to put it into the weapon.

Parameters
ammoItemThe inventory list that can be used outside of this function for the found ammo
invThe inventory to do the search in
weaponThe weapon to reload
Returns
NONE if no container was found, the container id otherwise.

Definition at line 916 of file cl_actor.cpp.

References CID_MAX, GAME_ItemIsUseable(), Inventory::getContainer2(), Item::getNext(), INVDEF, objDef_s::isLoadableInWeapon(), and NONE.

Referenced by CL_ActorReload(), and HUD_CalcReloadTime().

le_t* CL_ActorGetFromCharacter ( const character_t chr)

Returns the local entity information for a character in the team list.

Parameters
[in]chrThe character to search the local entity for.
Returns
A pointer to a le_t struct.

Definition at line 141 of file cl_actor.cpp.

References cl, i, clientBattleScape_s::numTeamList, clientBattleScape_s::teamList, le_s::ucn, and character_s::ucn.

int CL_ActorGetNumber ( const le_t le)

Returns the number of the actor in the teamlist.

Parameters
[in]leThe actor to search.
Returns
The number of the actor in the teamlist. Or -1 if the given entity is not in the team list.

Definition at line 125 of file cl_actor.cpp.

References cl, clientBattleScape_s::numTeamList, and clientBattleScape_s::teamList.

Referenced by CL_ActorAddToTeamList(), CL_ActorSelect(), CL_ActorWound(), and HUD_UpdateActorStats().

const fireDef_t* CL_ActorGetReactionFireFireDef ( const le_t shooter)
Parameters
[in]shooterThe local entity to get the reaction fire firedef from
Returns
The current selected firedef for reaction fire or nullptr if there is none

Definition at line 171 of file cl_actor.cpp.

References CL_ActorGetChr(), Item::getFiredefs(), FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), le_s::getHandItem(), MAX_FIREDEFS_PER_WEAPON, and character_s::RFmode.

Referenced by CL_ActorIsReactionFireOutOfRange(), and CL_ActorReactionFireAddTarget().

float CL_ActorInjuryModifier ( const le_t le,
const modifier_types_t  type 
)
void CL_ActorInvMove ( const le_t le,
containerIndex_t  fromContainer,
int  fromX,
int  fromY,
containerIndex_t  toContainer,
int  toX,
int  toY 
)

Sends an inventory move event to the server.

Parameters
leThe le that is doing the inventory move (an actor)
fromContainerThe container to fetch the item from
fromXThe x position in the container to get the item from
fromYThe y position in the container to get the item from
toContainerThe container to store the item in
toXThe x position in the container to move the item to
toYThe y position in the container to move the item to

Definition at line 1004 of file cl_actor.cpp.

References _, Inventory::canHoldItemWeight(), CL_ActorGetChr(), CL_BattlescapeRunning(), le_s::entnum, GAME_GetChrMaxLoad(), Inventory::getItemAtPos(), le_s::inv, INVDEF, LE_IsActor(), MSG_Write_PA(), PA_INVMOVE, and UI_Popup().

Referenced by CL_ActorReload(), and uiContainerNode::onDndFinished().

bool CL_ActorIsReactionFireOutOfRange ( const le_t shooter,
const le_t target 
)
Parameters
[in]shooterThe local entity to get the reaction fire definition for the range check for
[in]targetThe target to calculate the distance to
Returns
true if the given target is out of range for the shooter with the current selected fire mode

Definition at line 199 of file cl_actor.cpp.

References CL_ActorGetReactionFireFireDef(), le_s::origin, fireDef_s::range, and VectorDist.

Referenced by CL_ActorReactionFireTargetUpdate().

bool CL_ActorMouseTrace ( void  )
int CL_ActorMoveMode ( const le_t le)

Decide how the actor will walk, taking into account autostanding.

Parameters
[in]lePointer to an actor for which we set the moving mode.

Definition at line 102 of file cl_actor.cpp.

References cl, le_s::fieldSize, Grid_ShouldUseAutostand(), cvar_s::integer, LE_IsCrouched, clientBattleScape_s::mapData, mousePos, clientBattleScape_s::pathMap, le_s::pos, mapData_s::routing, RT_CanActorStandHere(), WALKTYPE_AUTOSTAND_BEING_USED, WALKTYPE_AUTOSTAND_BUT_NOT_FAR_ENOUGH, WALKTYPE_CROUCH_WALKING, and WALKTYPE_WALKING.

Referenced by HUD_UpdateActorMove().

void CL_ActorPlaySound ( const le_t le,
actorSound_t  soundType 
)

Plays various sounds on actor action.

Parameters
[in]leThe actor
[in]soundTypeType of action (among actorSound_t) for which we need a sound.

Definition at line 2134 of file cl_actor.cpp.

References Com_DPrintf(), DEBUG_CLIENT, DEBUG_SOUND, le_s::gender, teamDef_s::getActorSound(), le_s::origin, S_LoadAndPlaySample(), SND_VOLUME_DEFAULT, SOUND_ATTN_IDLE, and le_s::teamDef.

Referenced by CL_ActorDie(), CL_ActorShootHidden(), CL_ActorStateChange(), LE_AddProjectile(), and LET_Projectile().

void CL_ActorReload ( le_t le,
containerIndex_t  containerID 
)

Reload weapon with actor.

Parameters
[in,out]leThe actor to reload the weapon for
[in]containerIDThe container to reload
See also
CL_ActorCheckAction

Definition at line 948 of file cl_actor.cpp.

References _, CID_LEFT, CID_RIGHT, CL_ActorCheckAction(), CL_ActorGetContainerForReload(), CL_ActorInvMove(), Item::def(), GAME_ItemIsUseable(), Inventory::getContainer2(), Item::getFirstShapePosition(), Item::getX(), Item::getY(), HUD_DisplayMessage(), le_s::inv, Item::isHeldTwoHanded(), objDef_s::isReloadable(), and NONE.

Referenced by HUD_ReloadLeft_f(), and HUD_ReloadRight_f().

void CL_ActorRemoveFromTeamList ( le_t le)

Removes an actor (from your team) from the team list.

See also
CL_ActorStateChange
CL_ActorAddToTeamList
Parameters
[in,out]lePointer to local entity struct of the actor of your team

Definition at line 400 of file cl_actor.cpp.

References cl, CL_ActorCleanup(), CL_ActorSelect(), i, LE_IsSelected, LE_IsStunned, clientBattleScape_s::numTeamList, clientBattleScape_s::teamList, and UI_ExecuteConfunc().

Referenced by CL_ActorDie(), and CL_ActorStateChange().

int CL_ActorReservedTUs ( const le_t le,
const reservation_types_t  type 
)

Returns the amount of reserved TUs for a certain type.

Parameters
[in]leThe actor to check.
[in]typeThe type to check. Use RES_ALL_ACTIVE to get all reserved TUs that are not "active" (e.g. RF is skipped if disabled). RES_ALL returns ALL of them, no matter what. See reservation_types_t for a list of options.
Returns
The reserved TUs for the given type.
-1 on error.

Definition at line 214 of file cl_actor.cpp.

References CL_ActorGetChr(), Com_DPrintf(), chrReservations_s::crouch, DEBUG_CLIENT, chrReservations_s::reaction, RES_ALL, RES_ALL_ACTIVE, RES_CROUCH, RES_REACTION, RES_SHOT, character_s::reservedTus, chrReservations_s::shot, le_s::state, and STATE_REACTION.

Referenced by CL_ActorStandCrouch_f(), CL_ActorStateChange(), CL_ActorUsableTUs(), HUD_CheckFiremodeReservation(), HUD_PopupFiremodeReservation(), HUD_ShotReserve_f(), HUD_ToggleCrouchReservation_f(), HUD_UpdateActorCvar(), HUD_UpdateActorMove(), HUD_UpdateActorStats(), HUD_UpdateButtons(), and HUD_UsableReactionTUs().

void CL_ActorReserveTUs ( const le_t le,
const reservation_types_t  type,
const int  tus 
)

Replace the reserved TUs for a certain type.

Parameters
[in]leThe actor to change it for.
[in]typeThe reservation type to be changed (i.e be replaced).
[in]tusHow many TUs to set.

Definition at line 273 of file cl_actor.cpp.

References CL_ActorGetChr(), chrReservations_s::crouch, le_s::entnum, MSG_Write_PA(), PA_RESERVE_STATE, RES_CROUCH, RES_REACTION, RES_SHOT, character_s::reservedTus, and chrReservations_s::shot.

Referenced by CL_ActorStateChange(), HUD_SetShootReservation(), and HUD_ToggleCrouchReservation_f().

void CL_ActorResetMoveLength ( le_t le)

Recalculates the currently selected Actor's move length.

Parameters
[in,out]lePointer to actor for which we reset move lenght.

Definition at line 764 of file cl_actor.cpp.

References le_s::actorMoveLength, CL_ActorMoveLength(), and mousePos.

Referenced by CL_ActorConditionalMoveCalc(), CL_ActorMouseTrace(), and CL_ActorStats().

bool CL_ActorSelectList ( int  num)

Selects an actor from a list.

This function is used to select an actor from the lists that are used in equipment and team assemble screens

Parameters
numThe index value from the list of actors
See also
CL_ActorSelect
Returns
true if selection was possible otherwise false

Definition at line 506 of file cl_actor.cpp.

References cl, CL_ActorSelect(), Cvar_SetValue(), LE_CenterView(), clientBattleScape_s::numTeamList, le_s::pos, and clientBattleScape_s::teamList.

Referenced by CL_ActorAddToTeamList(), CL_ActorSelect_f(), CL_ActorSelectNext(), and CL_ActorSelectPrev().

bool CL_ActorSelectNext ( void  )

selects the next actor

Definition at line 527 of file cl_actor.cpp.

References cl, CL_ActorSelectList(), i, le_s::inuse, LE_IsDead, LE_IsSelected, clientBattleScape_s::numTeamList, and clientBattleScape_s::teamList.

Referenced by CL_ActorNext_f().

bool CL_ActorSelectPrev ( void  )

selects the previous actor

Definition at line 558 of file cl_actor.cpp.

References cl, CL_ActorSelectList(), i, le_s::inuse, LE_IsDead, LE_IsSelected, clientBattleScape_s::numTeamList, and clientBattleScape_s::teamList.

Referenced by CL_ActorPrev_f().

void CL_ActorSetFireDef ( le_t actor,
const fireDef_t fd 
)

Definition at line 91 of file cl_actor.cpp.

References le_s::fd, and mousePosTargettingAlign.

Referenced by HUD_UpdateActorFireMode().

void CL_ActorShoot ( const le_t le,
const pos3_t  at 
)
void CL_ActorTargetAlign_f ( void  )

Targets to the ground when holding the assigned button.

See also
mousePosTargettingAlign

Definition at line 1924 of file cl_actor.cpp.

References le_s::actorMode, CL_ActorFireModeActivated(), Cmd_Argc(), Cmd_Argv(), le_s::fd, fireDef_s::gravity, GROUND_DELTA, and mousePosTargettingAlign.

Referenced by CL_InitLocal().

int CL_ActorTimeForFireDef ( const le_t le,
const fireDef_t fd,
bool  reaction 
)

Find the TUs needed for the given fireDef taking into account the actor wound penalties.

Parameters
[in]leThe actor.
[in]fdThe fire definition.
[in]reactionWhether this is a normal or reaction fire shot.
Returns
The TUs needed for the fireDef for this actor.

Definition at line 342 of file cl_actor.cpp.

References CL_ActorInjuryModifier(), MODIFIER_REACTION, MODIFIER_SHOOTING, and fireDef_s::time.

Referenced by HUD_CheckFiremodeReservation(), HUD_DisplayFiremodeEntry(), HUD_FireWeapon_f(), HUD_PopupFiremodeReservation(), HUD_ReactionFireGetTUs(), and HUD_UpdateActorFireMode().

int CL_ActorUsableTUs ( const le_t le)
bool CL_AddActor ( le_t le,
entity_t ent 
)

Adds an actor to the render entities with all it's models and items.

Parameters
[in]leThe local entity to get the values from
[in]entThe body entity used in the renderer
See also
CL_AddUGV
LE_AddToScene
CL_ActorAppear
Note
Called via addfunc for each local entity in every frame

Add actor special effects. Only draw blood if the actor is dead or (if stunned) was damaged more than half its maximum HPs.

Todo:
Better value for this?

Definition at line 1515 of file cl_actor.cpp.

References le_s::alpha, cl, CL_AddActorWeapon(), CL_ParticleSpawn(), cls, Com_Error(), teamDef_s::deathTextureName, ERR_DROP, le_s::headSkin, le_s::HP, i, cvar_s::integer, it_effect, LE_IsDead, LE_IsSelected, LE_IsStunned, le_s::left, le_s::maxHP, le_s::model1, le_s::model2, client_static_s::modelPool, le_s::origin, PATHFINDING_HEIGHT, clientBattleScape_s::pnum, le_s::pnum, le_s::pos, le_s::ptl, R_AddEntity(), R_FindImage(), R_GetFreeEntity(), R_GetTagIndexByName(), RF_ACTOR, RF_ALLIED, RF_BLOOD, RF_IRGOGGLES, RF_MEMBER, RF_NEUTRAL, RF_NONE, RF_OPPONENT, RF_SELECTED, RF_SHADOW, le_s::right, client_static_s::team, le_s::team, TEAM_CIVILIAN, and le_s::teamDef.

Referenced by CL_ActorAppear().

void CL_AddActorPathing ( void  )

Adds an actor pathing marker to the current floor when we render the world.

See also
CL_ViewRender Draws the tracer (red, yellow, green box) on the grid

Definition at line 2109 of file cl_actor.cpp.

References CL_AddPathingBox(), cl_worldlevel, i, cvar_s::integer, and PATHFINDING_WIDTH.

Referenced by CL_ViewRender().

void CL_AddPathing ( void  )

Adds a pathing marker to the current floor when we render the world.

See also
CL_ViewRender Draws the tracer (red, yellow, green box) on the grid

Definition at line 2089 of file cl_actor.cpp.

References CL_AddPathingBox(), cl_worldlevel, cvar_s::integer, mousePos, and PATHFINDING_WIDTH.

Referenced by CL_ViewRender().

bool CL_AddUGV ( le_t le,
entity_t ent 
)

Adds an UGV to the render entities.

Parameters
[in]leThe local entity the UGV should be created from
[out]ent
See also
CL_AddActor
Todo:

Definition at line 35 of file cl_ugv.cpp.

Referenced by CL_ActorAppear().

void CL_BattlescapeMouseDragging ( void  )

Scroll battlescape touchscreen-style, by clicking and dragging away.

Definition at line 1467 of file cl_actor.cpp.

References clientBattleScape_s::cam, cl, CL_GetWorldCoordsUnderMouse(), Cvar_SetValue(), f, mouseDraggingPos, camera_s::origin, truePos, VectorMA(), and VectorSubtract.

Referenced by CL_ProcessMouseDragging().

void CL_DisplayFloorArrows ( void  )

Useful for debugging pathfinding.

Definition at line 2166 of file cl_actor.cpp.

References ACTOR_GET_FIELDSIZE, cl, CL_AddArrow(), Grid_PosToVec(), clientBattleScape_s::mapData, QUANT, mapData_s::routing, truePos, and VectorCopy.

Referenced by CL_ViewRender().

void CL_DisplayObstructionArrows ( void  )

Useful for debugging pathfinding.

Definition at line 2180 of file cl_actor.cpp.

References ACTOR_GET_FIELDSIZE, cl, CL_AddArrow(), Grid_PosToVec(), clientBattleScape_s::mapData, mapData_s::routing, truePos, and VectorCopy.

Referenced by CL_ViewRender().

void CL_GetWorldCoordsUnderMouse ( vec3_t  groundIntersection,
vec3_t  upperTracePoint,
vec3_t  lowerTracePoint 
)

Get battlescape cell position under mouse cursor.

Note
The returned position might be out of world boundaries, or under the ground etc.
Parameters
[out]groundIntersectionPoint on the ground under the mouse cursor, in the world coordinates
[out]upperTracePointPoint in the sky under the mouse cursor, in the world coordinates
[out]lowerTracePointPoint below the ground under the mouse cursor, at the world boundary
See also
CL_ActorMouseTrace

Definition at line 1290 of file cl_actor.cpp.

References camera_s::axis, clientBattleScape_s::cam, camera_s::camorg, cl, cl_isometric, cl_worldlevel, CM_EntTestLineDM(), CURSOR_OFFSET, DotProduct, rendererData_t::fieldOfViewX, cvar_s::integer, clientBattleScape_s::leInlineModelList, M_PI, clientBattleScape_s::mapTiles, mousePosX, mousePosY, refdef, viddef_t::rx, viddef_t::ry, TL_FLAG_ACTORCLIP, UNIT_HEIGHT, VectorAdd, VectorCopy, VectorMA(), VectorScale, VectorSet, VectorSubtract, viddef, viddef_t::viewHeight, viddef_t::viewWidth, viddef_t::x, and viddef_t::y.

Referenced by CL_ActorMouseTrace(), CL_BattlescapeMouseDragging(), and CL_InitBattlescapeMouseDragging().

void CL_InitBattlescapeMouseDragging ( void  )

Scroll battlescape touchscreen-style, by clicking and dragging away.

Definition at line 1459 of file cl_actor.cpp.

References CL_GetWorldCoordsUnderMouse(), and mouseDraggingPos.

Referenced by CL_SelectDown_f().

void CL_NextRound_f ( void  )
void CL_ResetMouseLastPos ( void  )
void MSG_Write_PA ( player_action_t  playerAction,
int  entnum,
  ... 
)

Writes player action with its data.

Parameters
[in]playerActionType of action.
[in]entnumThe server side edict number of the actor

Definition at line 73 of file cl_actor.cpp.

References clc_action, cls, NET_vWriteFormat(), NET_WriteFormat(), NET_WriteMsg(), client_static_s::netStream, and pa_format.

Referenced by CL_ActorInvMove(), CL_ActorReserveTUs(), CL_ActorShoot(), CL_ActorStandCrouch_f(), CL_ActorStartMove(), CL_ActorTurnMouse(), CL_ActorUse(), HUD_ToggleReaction_f(), and HUD_UpdateReactionFiremodes().

Variable Documentation

pos3_t truePos

The cell at the current worldlevel under the mouse cursor.

Definition at line 50 of file cl_actor.cpp.

Referenced by CL_ActorMouseTrace(), CL_BattlescapeMouseDragging(), CL_DisplayFloorArrows(), CL_DisplayObstructionArrows(), and HUD_MapDebugCursor().