233 {
235 m_VicinityObjects.ClearVicinityObjects();
237
238 Object firstValidRaycastedObject = null;
239 array<Object> vicinityObjects = new array<Object>;
240
242 vector playerPos =
m_Player.GetPosition();
243 vector headingDirection = MiscGameplayFunctions.GetHeadingVector(
m_Player);
244
247
250
251 array<ref RaycastRVResult> results = new array<ref RaycastRVResult>();
252 array<RaycastRVResult> sortedValidRaycastResults = new array<RaycastRVResult>();
254
255 if (DayZPhysics.RaycastRVProxy(rayInput, results))
256 {
259 if (sortedResultsCount > 0 )
260 {
261 foreach (int sortedDist : sortedDistanceHelper)
262 {
263 array<RaycastRVResult> sameDistResults =
m_SortedResults.Get(sortedDist);
264
265 foreach (RaycastRVResult res : sameDistResults)
266 {
267 if (res.obj && !res.obj.CanBeActionTarget())
268 continue;
269
271 if (res.hierLevel > 0)
272 {
275 continue;
276 }
277
278 sortedValidRaycastResults.Insert(res);
279 resultMap.Insert(res.obj, res);
280 if (!firstValidRaycastedObject)
281 firstValidRaycastedObject = res.obj;
282
285
286 if (res.surface && res.surface.GetSurfaceType() != "")
287 {
289 }
290 else
291 {
293 SurfaceDetectionParameters surfaceParams = new SurfaceDetectionParameters();
298 surfaceParams.
rsd = RoadSurfaceDetection.ABOVE;
299
301 SurfaceDetectionResult surfaceResult = new SurfaceDetectionResult();
302 if (
g_Game.GetSurface(surfaceParams, surfaceResult))
303 {
304 if (surfaceResult && surfaceResult.
surface)
305 {
307 }
308 }
309 }
310 break;
311 }
312 }
313 }
314 }
315 else
316 {
317 firstValidRaycastedObject = null;
320 }
321
324 if (camera && camera.GetCurrentPitch() <= -45)
326
328 vicinityObjects.RemoveItem(
m_Player);
329
331
333 m_VicinityObjects.TransformToVicinityObjects(vicinityObjects);
334
337
339 int vicinityObjCount = m_VicinityObjects.Count();
340 for (int i = 0; i < vicinityObjCount; ++i)
341 {
342 Object object = m_VicinityObjects.GetObject(i);
344 RaycastRVResult result;
345 int targetComponent;
346 vector hitpos;
347
348 if (resultMap.Find(object, result))
349 {
353 }
354 else
355 {
356 parent = m_VicinityObjects.GetParent(i);
358 targetComponent = -1;
359 }
360
362 if (utility > 0)
363 {
367
370 }
371 }
372
375 {
376 vector contact_pos, contact_dir, hitNormal;
377 int contactComponent;
380
382
386 }
387
389
390#ifdef DIAG_DEVELOPER
391 if (DiagMenu.GetBool(
DiagMenuIDs.MISC_ACTION_TARGETS_DEBUG))
392 {
393 ShowDebugActionTargets(true);
394 DrawDebugActionTargets(true);
395 DrawDebugCone(true);
396 DrawDebugRay(true);
397 DrawSelectionPos(DiagMenu.GetBool(
DiagMenuIDs.MISC_ACTION_TARGETS_SELPOS_DEBUG));
398 }
399 else
400 {
401 ShowDebugActionTargets(false);
402 DrawDebugActionTargets(false);
403 DrawDebugCone(false);
404 DrawDebugRay(false);
405 DrawSelectionPos(false);
406 }
407#endif
408 }
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
void DayZPlayerUtils()
cannot be instantiated
SurfaceInfo m_SurfaceInfo
first valid hitpos! Used only as rough reference value for conecasted results.
const float c_MaxTargetDistance
ref map< int, ref array< RaycastRVResult > > m_SortedResults
array< int > SortResultsDistance(array< ref RaycastRVResult > results)
void FilterDuplicateVicinityObjects(inout array< Object > vicinityObjectsOutput, array< RaycastRVResult > sortedRaycastResults)
void StoreTarget(ActionTarget pActionTarget)
inserts action into sorted array based on utility
bool IsRaycastResultException(RaycastRVResult res)
Initial raycast filtering exceptions (can't ask the entity type, sadly)
const float c_RayDistance
searching properties
PlayerBase m_Player
player owner
void FilterObstructedObjectsEx(Object cursor_target, array< Object > vicinityObjects)
vector m_RayStart
objects in vicinity
ref array< ref ActionTarget > m_Targets
selected & sorted targets by utility function
float ComputeUtility(Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos)
computes utility of target
const float c_ConeHeightMax
const float c_ConeHeightMin
int component
index of component in corresponding geometry level
vector pos
position of collision (in world coord)
Object parent
if hierLevel > 0 most parent of the proxy object
bool includeWater
Include water in the surface detection, will return the water if it is higher than the surface.
SurfaceDetectionType type
Type of surface to detect.
RoadSurfaceDetection rsd
See RoadSurfaceDetection, SurfaceTraceType.Roadway only.
vector position
3D position to trace the surface from
UseObjectsMode syncMode
See UseObjectsMode, SurfaceTraceType.Roadway only.
SurfaceInfo surface
Returned SurfaceInfo, plain pointer.
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)