Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
ActionTargets Class Reference

Private Member Functions

void ActionTargets (PlayerBase player)
vector CalculateRayStart ()
 DEPRECATED.
void Clear ()
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 FilterObstructedObjects (Object cursor_target)
void FilterObstructedObjectsEx (Object cursor_target, array< Object > vicinityObjects)
int FindIndexForStoring (float value)
 binary search algorithm
ActionTarget GetTarget (int index)
 returns action target at index
int GetTargetsCount ()
 returns count of founded targets
bool IsObstructed (Object object)
bool IsObstructedEx (Object object, IsObjectObstructedCache cache)
void StoreTarget (ActionTarget pActionTarget)
 inserts action into sorted array based on utility
void Update ()

Static Private Member Functions

static array< ObjectGetVicinityObjects ()

Private Attributes

const float c_ConeAngle = 30.0
const float c_ConeHeightMax = 2.0
const float c_ConeHeightMin = -0.5
const float c_DistanceDelta = 0.3
const float c_MaxActionDistance = UAMaxDistances.DEFAULT
const float c_MaxTargetDistance = 3.0
const float c_RayDistance = 5.0
 searching properties
const float c_UtilityMaxDistFromRaySqr = 0.8 * 0.8
const float c_UtilityMaxValue = 10000
 utility constants
const string CE_CENTER = "ce_center"
 p3d
const int GROUPING_COUNT_THRESHOLD = 10
const float HEIGHT_OFFSET = 0.2
vector m_HitPos
PlayerBase m_Player
 player owner
vector m_RayEnd
ref array< ref ActionTargetm_Targets
 selected & sorted targets by utility function
const int OBSTRUCTED_COUNT_THRESHOLD = 3
 misc

Static Private Attributes

vector m_RayStart
 objects in vicinity

Detailed Description

Definition at line 173 of file actiontargets.c.

Constructor & Destructor Documentation

◆ ActionTargets()

void ActionTargets ( PlayerBase player)
inlineprivate

Definition at line 175 of file actiontargets.c.

References m_Player, and m_VicinityObjects.

Member Function Documentation

◆ CalculateRayStart()

vector CalculateRayStart ( )
private

DEPRECATED.

◆ Clear()

void Clear ( )
inlineprivate

Definition at line 189 of file actiontargets.c.

◆ ComputeUtility()

float ComputeUtility ( Object pTarget,
vector pRayStart,
vector pRayEnd,
Object cursorTarget,
vector hitPos )
inlineprivate

computes utility of target

out of reach

ground and static objects

basebuilding objects

Definition at line 406 of file actiontargets.c.

References c_MaxTargetDistance, c_UtilityMaxDistFromRaySqr, c_UtilityMaxValue, vector::DistanceSq(), DistSqrPoint2Line(), and m_Player.

◆ DistSqrPoint2Line()

float DistSqrPoint2Line ( vector pPoint,
vector pL1,
vector pL2 )
inlineprivate

distance between point and line

Definition at line 452 of file actiontargets.c.

References vector::DistanceSq(), and vector::Dot().

Referenced by ComputeUtility().

◆ FilterObstructedObjects()

void FilterObstructedObjects ( Object cursor_target)
inlineprivate

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 499 of file actiontargets.c.

References IsObjectObstructedCache(), IsObstructedEx(), m_RayStart, m_VicinityObjects, and OBSTRUCTED_COUNT_THRESHOLD.

Referenced by FilterObstructedObjectsEx().

◆ FilterObstructedObjectsEx()

void FilterObstructedObjectsEx ( Object cursor_target,
array< Object > vicinityObjects )
inlineprivate

◆ FindIndexForStoring()

int FindIndexForStoring ( float value)
inlineprivate

binary search algorithm

Definition at line 385 of file actiontargets.c.

References m_Targets.

Referenced by StoreTarget().

◆ GetTarget()

ActionTarget GetTarget ( int index)
inlineprivate

returns action target at index

Definition at line 373 of file actiontargets.c.

References ActionTarget, and m_Targets.

◆ GetTargetsCount()

int GetTargetsCount ( )
inlineprivate

returns count of founded targets

Definition at line 369 of file actiontargets.c.

References m_Targets.

◆ GetVicinityObjects()

array< Object > GetVicinityObjects ( )
inlinestaticprivate

Definition at line 184 of file actiontargets.c.

References m_VicinityObjects.

◆ IsObstructed()

bool IsObstructed ( Object object)
inlineprivate

Definition at line 357 of file actiontargets.c.

References IsObjectObstructedCache(), IsObstructedEx(), and m_RayStart.

◆ IsObstructedEx()

bool IsObstructedEx ( Object object,
IsObjectObstructedCache cache )
inlineprivate

Definition at line 363 of file actiontargets.c.

References IsObjectObstructedCache().

Referenced by FilterObstructedObjects(), and IsObstructed().

◆ StoreTarget()

void StoreTarget ( ActionTarget pActionTarget)
inlineprivate

inserts action into sorted array based on utility

Definition at line 377 of file actiontargets.c.

References ActionTarget, FindIndexForStoring(), and m_Targets.

◆ Update()

void Update ( )
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 194 of file actiontargets.c.

Field Documentation

◆ c_ConeAngle

const float c_ConeAngle = 30.0
private

Definition at line 733 of file actiontargets.c.

◆ c_ConeHeightMax

const float c_ConeHeightMax = 2.0
private

Definition at line 735 of file actiontargets.c.

◆ c_ConeHeightMin

const float c_ConeHeightMin = -0.5
private

Definition at line 734 of file actiontargets.c.

◆ c_DistanceDelta

const float c_DistanceDelta = 0.3
private

Definition at line 736 of file actiontargets.c.

Referenced by FilterObstructedObjectsEx().

◆ c_MaxActionDistance

const float c_MaxActionDistance = UAMaxDistances.DEFAULT
private

Definition at line 732 of file actiontargets.c.

◆ c_MaxTargetDistance

const float c_MaxTargetDistance = 3.0
private

Definition at line 731 of file actiontargets.c.

Referenced by ComputeUtility(), and FilterObstructedObjectsEx().

◆ c_RayDistance

const float c_RayDistance = 5.0
private

searching properties

Definition at line 730 of file actiontargets.c.

◆ c_UtilityMaxDistFromRaySqr

const float c_UtilityMaxDistFromRaySqr = 0.8 * 0.8
private

Definition at line 740 of file actiontargets.c.

Referenced by ComputeUtility().

◆ c_UtilityMaxValue

const float c_UtilityMaxValue = 10000
private

utility constants

Definition at line 739 of file actiontargets.c.

Referenced by ComputeUtility().

◆ CE_CENTER

const string CE_CENTER = "ce_center"
private

p3d

Definition at line 743 of file actiontargets.c.

◆ GROUPING_COUNT_THRESHOLD

const int GROUPING_COUNT_THRESHOLD = 10
private

Definition at line 748 of file actiontargets.c.

Referenced by FilterObstructedObjectsEx().

◆ HEIGHT_OFFSET

const float HEIGHT_OFFSET = 0.2
private

Definition at line 744 of file actiontargets.c.

◆ m_HitPos

vector m_HitPos
private

Definition at line 724 of file actiontargets.c.

◆ m_Player

player owner

Definition at line 712 of file actiontargets.c.

Referenced by ActionTargets(), and ComputeUtility().

◆ m_RayEnd

vector m_RayEnd
private

Definition at line 723 of file actiontargets.c.

◆ m_RayStart

vector m_RayStart
staticprivate

objects in vicinity

Definition at line 722 of file actiontargets.c.

Referenced by FilterObstructedObjects(), FilterObstructedObjectsEx(), and IsObstructed().

◆ m_Targets

ref array<ref ActionTarget> m_Targets
private

selected & sorted targets by utility function

Definition at line 715 of file actiontargets.c.

Referenced by FindIndexForStoring(), GetTarget(), GetTargetsCount(), and StoreTarget().

◆ OBSTRUCTED_COUNT_THRESHOLD

const int OBSTRUCTED_COUNT_THRESHOLD = 3
private

misc

Definition at line 747 of file actiontargets.c.

Referenced by FilterObstructedObjects().


The documentation for this class was generated from the following file:
  • F:/Games/Dayz/scripts/4_world/classes/useractionscomponent/actiontargets.c