Private Member Functions | |
void | ActionTargets (PlayerBase player) |
void | Clear () |
void | Update () |
private bool | IsObstructed (Object object) |
private bool | IsObstructedEx (Object object, IsObjectObstructedCache cache) |
int | GetTargetsCount () |
returns count of founded targets | |
ActionTarget | GetTarget (int index) |
returns action target at index | |
private void | StoreTarget (ActionTarget pActionTarget) |
inserts action into sorted array based on utility | |
private int | FindIndexForStoring (float value) |
binary search algorithm | |
private float | ComputeUtility (Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos, SurfaceInfo surfaceInfo) |
computes utility of target | |
private float | DistSqrPoint2Line (vector pPoint, vector pL1, vector pL2) |
distance between point and line | |
private void | FilterObstructedObjectsEx (Object cursor_target, array< Object > vicinityObjects) |
private void | FilterObstructedObjects (Object cursor_target) |
vector | CalculateRayStart () |
DEPRECATED. | |
Static Private Member Functions | |
static array< Object > | GetVicinityObjects () |
Private Attributes | |
private PlayerBase | m_Player |
player owner | |
private ref array< ref ActionTarget > | m_Targets |
selected & sorted targets by utility function | |
private vector | m_RayEnd |
private vector | m_HitPos |
private SurfaceInfo | m_SurfaceInfo |
private const float | c_RayDistance = 5.0 |
searching properties | |
private const float | c_MaxTargetDistance = 3.0 |
private const float | c_MaxActionDistance = UAMaxDistances.DEFAULT |
private const float | c_ConeAngle = 30.0 |
private const float | c_ConeHeightMin = -0.5 |
private const float | c_ConeHeightMax = 2.0 |
private const float | c_DistanceDelta = 0.3 |
private const float | c_UtilityMaxValue = 10000 |
utility constants | |
private const float | c_UtilityMaxDistFromRaySqr = 0.8 * 0.8 |
private const string | CE_CENTER = "ce_center" |
p3d | |
private const float | HEIGHT_OFFSET = 0.2 |
private const int | OBSTRUCTED_COUNT_THRESHOLD = 3 |
misc | |
private const int | GROUPING_COUNT_THRESHOLD = 10 |
Static Private Attributes | |
static private ref VicinityObjects m_VicinityObjects private bool m_Debug private vector | m_RayStart |
objects in vicinity | |
|
inlineprivate |
|
private |
DEPRECATED.
|
inlineprivate |
References m_Targets.
Referenced by Update(), and ActionManagerClient::Update().
|
inlineprivate |
computes utility of target
out of reach
ground and static objects
basebuilding objects
surfaces with liquid source
References c_MaxTargetDistance, c_UtilityMaxDistFromRaySqr, c_UtilityMaxValue, vector::DistanceSq(), DistSqrPoint2Line(), SurfaceInfo::GetLiquidType(), LIQUID_NONE, and m_Player.
Referenced by Update().
distance between point and line
References vector::DistanceSq(), and vector::Dot().
Referenced by ComputeUtility().
|
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
References IsObjectObstructedCache(), IsObstructedEx(), m_RayStart, and OBSTRUCTED_COUNT_THRESHOLD.
Referenced by FilterObstructedObjectsEx().
|
inlineprivate |
References c_DistanceDelta, c_MaxTargetDistance, CleanupDebugShapes(), FilterObstructedObjects(), g_Game, DiagMenu::GetBool(), GROUPING_COUNT_THRESHOLD, and m_RayStart.
Referenced by Update().
|
inlineprivate |
returns action target at index
References ActionTarget(), and m_Targets.
Referenced by ActionManagerClient::FindActionTarget().
|
inlineprivate |
returns count of founded targets
References m_Targets.
Referenced by ActionManagerClient::FindActionTarget().
References IsObjectObstructedCache(), IsObstructedEx(), and m_RayStart.
|
inlineprivate |
Referenced by FilterObstructedObjects(), and IsObstructed().
|
inlineprivate |
inserts action into sorted array based on utility
References FindIndexForStoring(), and m_Targets.
Referenced by Update().
|
inlineprivate |
clear state
camera & ray properties
if the cursor target is a proxy
ignores attachments on player
Need to do this surface detection here as the current RaycastRVResult might not contain the correct surface info
Check current surface player is looking at
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)
References ActionTarget(), c_ConeAngle, c_ConeHeightMax, c_ConeHeightMin, c_MaxTargetDistance, c_RayDistance, Class::CastTo(), Clear(), RaycastRVResult::component, ComputeUtility(), DayZPlayerCamera(), DayZPlayerUtils(), vector::DistanceSq(), FilterObstructedObjectsEx(), RaycastRVParams::flags, g_Game, DiagMenu::GetBool(), CGame::GetCurrentCameraDirection(), CGame::GetCurrentCameraPosition(), SurfaceInfo::GetEntryName(), GetGame(), SurfaceInfo::GetSurfaceType(), RaycastRVResult::hierLevel, SurfaceDetectionParameters::includeWater, m_HitPos, m_Player, m_RayEnd, m_RayStart, m_SurfaceInfo, m_Targets, RaycastRVResult::obj, RaycastRVResult::parent, RaycastRVResult::pos, SurfaceDetectionParameters::position, DayZPhysics::RayCastBullet(), DayZPhysics::RaycastRVProxy(), SurfaceDetectionParameters::rsd, StoreTarget(), RaycastRVResult::surface, SurfaceDetectionResult::surface, SurfaceDetectionParameters::syncMode, SurfaceDetectionParameters::type, and vector::Zero.
Referenced by ActionManagerClient::Update().
|
private |
Referenced by FilterObstructedObjectsEx().
|
private |
|
private |
Referenced by ComputeUtility(), FilterObstructedObjectsEx(), and Update().
|
private |
Referenced by ComputeUtility().
|
private |
utility constants
Referenced by ComputeUtility().
|
private |
p3d
|
private |
Referenced by FilterObstructedObjectsEx().
|
private |
|
private |
player owner
Referenced by ActionTargets(), ComputeUtility(), and Update().
|
staticprivate |
objects in vicinity
Referenced by FilterObstructedObjects(), FilterObstructedObjectsEx(), IsObstructed(), and Update().
|
private |
Referenced by Update().
|
private |
selected & sorted targets by utility function
Referenced by ActionTargets(), Clear(), FindIndexForStoring(), GetTarget(), GetTargetsCount(), StoreTarget(), and Update().
|
private |
misc
Referenced by FilterObstructedObjects().