DayZ 1.24
|
Private Member Functions | |
void | ActionTargets (PlayerBase player) |
void | Clear () |
void | Update () |
bool | IsObstructed (Object object) |
bool | IsObstructedEx (Object object, IsObjectObstructedCache cache) |
int | GetTargetsCount () |
returns count of founded targets | |
ActionTarget | GetTarget (int index) |
returns action target at index | |
void | StoreTarget (ActionTarget pActionTarget) |
inserts action into sorted array based on utility | |
int | FindIndexForStoring (float value) |
binary search algorithm | |
float | ComputeUtility (Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos) |
computes utility of target | |
float | DistSqrPoint2Line (vector pPoint, vector pL1, vector pL2) |
distance between point and line | |
void | FilterObstructedObjectsEx (Object cursor_target, array< Object > vicinityObjects) |
void | FilterObstructedObjects (Object cursor_target) |
vector | CalculateRayStart () |
DEPRECATED. | |
Static Private Member Functions | |
static array< Object > | GetVicinityObjects () |
Private Attributes | |
PlayerBase | m_Player |
player owner | |
ref array< ref ActionTarget > | m_Targets |
selected & sorted targets by utility function | |
vector | m_RayEnd |
vector | m_HitPos |
const float | c_RayDistance = 5.0 |
searching properties | |
const float | c_MaxTargetDistance = 3.0 |
const float | c_MaxActionDistance = UAMaxDistances.DEFAULT |
const float | c_ConeAngle = 30.0 |
const float | c_ConeHeightMin = -0.5 |
const float | c_ConeHeightMax = 2.0 |
const float | c_DistanceDelta = 0.3 |
const float | c_UtilityMaxValue = 10000 |
utility constants | |
const float | c_UtilityMaxDistFromRaySqr = 0.8 * 0.8 |
const string | CE_CENTER = "ce_center" |
p3d | |
const float | HEIGHT_OFFSET = 0.2 |
const int | OBSTRUCTED_COUNT_THRESHOLD = 3 |
misc | |
const int | GROUPING_COUNT_THRESHOLD = 10 |
Static Private Attributes | |
vector | m_RayStart |
objects in vicinity | |
Definition at line 169 of file ActionTargets.c.
|
inlineprivate |
Definition at line 171 of file ActionTargets.c.
References m_Player, m_VicinityObjects, and VicinityObjects().
|
private |
DEPRECATED.
|
inlineprivate |
Definition at line 185 of file ActionTargets.c.
References m_Targets.
|
inlineprivate |
computes utility of target
out of reach
ground and static objects
basebuilding objects
Definition at line 402 of file ActionTargets.c.
References c_MaxTargetDistance, c_UtilityMaxDistFromRaySqr, c_UtilityMaxValue, vector::DistanceSq(), DistSqrPoint2Line(), and m_Player.
distance between point and line
Definition at line 445 of file ActionTargets.c.
References vector::DistanceSq(), and vector::Dot().
Referenced by ComputeUtility().
check if targets are not obstructed (eg.: wall)
check for object obstruction(if the object is not a proxy - has no parent)
when the number of obstructed items is higher than OBSTRUCTED_COUNT_THRESHOLD remove do no run obstruction check and skip these items
obstruction check
Definition at line 490 of file ActionTargets.c.
References IsObjectObstructedCache(), IsObstructedEx(), m_RayStart, m_VicinityObjects, and OBSTRUCTED_COUNT_THRESHOLD.
Referenced by FilterObstructedObjectsEx().
|
inlineprivate |
Definition at line 461 of file ActionTargets.c.
References c_DistanceDelta, c_MaxTargetDistance, FilterObstructedObjects(), g_Game, DiagMenu::GetBool(), GROUPING_COUNT_THRESHOLD, m_RayStart, and m_VicinityObjects.
binary search algorithm
Definition at line 381 of file ActionTargets.c.
References m_Targets.
Referenced by StoreTarget().
|
inlineprivate |
returns action target at index
Definition at line 369 of file ActionTargets.c.
References m_Targets.
|
inlineprivate |
returns count of founded targets
Definition at line 365 of file ActionTargets.c.
References m_Targets.
Definition at line 180 of file ActionTargets.c.
References m_VicinityObjects.
Definition at line 353 of file ActionTargets.c.
References IsObjectObstructedCache(), IsObstructedEx(), and m_RayStart.
|
inlineprivate |
Definition at line 359 of file ActionTargets.c.
Referenced by FilterObstructedObjects(), and IsObstructed().
|
inlineprivate |
inserts action into sorted array based on utility
Definition at line 373 of file ActionTargets.c.
References FindIndexForStoring(), and m_Targets.
|
inlineprivate |
clear state
camera & ray properties
if the cursor target is a proxy
ignores attachments on player
spacial search
removes player from the vicinity
transformation of array of Objects to hashmap (VicinityObjects)
removes Vicinity objects that are not directly visible from player position
select & sort targets based on utility function
action target for surface actions (lowest utility)
Definition at line 190 of file ActionTargets.c.
Definition at line 717 of file ActionTargets.c.
Definition at line 719 of file ActionTargets.c.
Definition at line 718 of file ActionTargets.c.
Definition at line 720 of file ActionTargets.c.
Referenced by FilterObstructedObjectsEx().
|
private |
Definition at line 716 of file ActionTargets.c.
Definition at line 715 of file ActionTargets.c.
Referenced by ComputeUtility(), and FilterObstructedObjectsEx().
searching properties
Definition at line 714 of file ActionTargets.c.
Definition at line 724 of file ActionTargets.c.
Referenced by ComputeUtility().
p3d
Definition at line 727 of file ActionTargets.c.
Definition at line 732 of file ActionTargets.c.
Referenced by FilterObstructedObjectsEx().
Definition at line 728 of file ActionTargets.c.
|
private |
Definition at line 708 of file ActionTargets.c.
|
private |
player owner
Definition at line 696 of file ActionTargets.c.
Referenced by ActionTargets(), and ComputeUtility().
|
private |
Definition at line 707 of file ActionTargets.c.
|
staticprivate |
objects in vicinity
Definition at line 706 of file ActionTargets.c.
Referenced by FilterObstructedObjects(), FilterObstructedObjectsEx(), and IsObstructed().
|
private |
selected & sorted targets by utility function
Definition at line 699 of file ActionTargets.c.
Referenced by Clear(), FindIndexForStoring(), GetTarget(), GetTargetsCount(), and StoreTarget().