DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionTargets.c
Go to the documentation of this file.
3{
5
7 {
9 }
10
12 void StoreVicinityObject(Object object, Object parent = null)
13 {
15 ItemBase ib = ItemBase.Cast(object);
16 if (ib && (ib.IsBeingPlaced() || ib.IsHologram()))
17 return;
18
20 /*if(object && object.IsPlainObject())
21 {
22 Print("ERROR: VicinityObjects | StoreVicinityObject | IsPlainObject check fail");
23 return;
24 }*/
25
26 if ( !m_VicinityObjects.Contains(object) )
27 {
29 m_VicinityObjects.Set(object, parent);
30 }
31 }
32
35 {
36 for (int i = 0; i < objects.Count(); i++)
37 {
38 if (objects[i].GetType() != "" && objects[i].CanBeActionTarget())
39 {
40 StoreVicinityObject(objects[i]);
41 //Print("storing, 2nd pass: " + objects[i]);
42 }
43 }
44 }
45
47 {
48 m_VicinityObjects.Clear();
49 }
50
53 {
54 ref array<Object> vicinityObjects = new array<Object>;
55 for (int i = 0; i < m_VicinityObjects.Count(); i++)
56 {
58 ItemBase ib = ItemBase.Cast(GetObject(i));
59 if (ib && !ib.IsTakeable())
60 continue;
61
62 vicinityObjects.Insert(GetObject(i));
63 }
64
65 return vicinityObjects;
66 }
67
70 {
71 ref array<Object> vicinityObjects = new array<Object>;
72 for (int i = 0; i < m_VicinityObjects.Count(); i++)
73 {
74 vicinityObjects.Insert(GetObject(i));
75 }
76
77 return vicinityObjects;
78 }
79
82 {
83 return m_VicinityObjects.GetKey(i);
84 }
85
88 {
89 return m_VicinityObjects.GetElement(i);
90 }
91
92 int Count()
93 {
94 return m_VicinityObjects.Count();
95 }
96
97 void Remove(Object object)
98 {
99 m_VicinityObjects.Remove(object);
100 }
101
102 void Remove(array<Object> objects)
103 {
104 for (int i = 0; i < objects.Count(); i++)
105 {
106 m_VicinityObjects.Remove(objects[i]);
107 }
108 }
109}
110
111class ActionTarget
112{
113 void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility)
115 m_Object = object;
116 m_Parent = parent;
117 m_ComponentIndex = componentIndex;
118 m_CursorHitPos = cursorHitPos;
119 m_Utility = utility;
120 }
121
123 { return m_Object; }
124
126 { return m_Parent; }
127
128 bool IsProxy()
129 {
130 if (m_Parent)
131 return true;
132 return false;
133 }
134
136 { return m_ComponentIndex; }
137
139 { return m_Utility; }
140
142 { return m_CursorHitPos; }
143
144 void SetCursorHitPos(vector cursor_position)
145 {
146 m_CursorHitPos = cursor_position;
147 }
148
150 {
152 }
153
155 {
156 string res = "ActionTarget dump = {";
157 res = res + "m_Object: " + Object.GetDebugName(m_Object);
158 res = res + "; m_Parent: " + Object.GetDebugName(m_Parent);
159 res = res + "; m_ComponentIndex: " + m_ComponentIndex.ToString();
160 res = res + "; m_CursorHitPos: " + m_CursorHitPos.ToString();
161 res = res + "; m_Utility: " + m_Utility.ToString();
162 res = res + "}";
163 return res;
164 }
165
166 private Object m_Object; // object itself
167 private Object m_Parent; // null or parent of m_Object
168 private int m_ComponentIndex; // p3d Component ID or -1
170 private float m_Utility;
171};
172
174{
176 {
177 m_Player = player;
180
181 m_Debug = false;
182 }
183
185 {
186 return m_VicinityObjects.GetVicinityObjects();
187 }
188
189 void Clear()
190 {
191 m_Targets.Clear();
192 }
193
194 void Update()
195 {
196 int i;
199 m_VicinityObjects.ClearVicinityObjects();
200 Clear();
201
202 Object cursorTarget = null;
203 EntityAI cursorTargetEntity = null;
204 array<Object> vicinityObjects = new array<Object>;
205
207 int hitComponentIndex;
208 vector playerPos = m_Player.GetPosition();
209 vector headingDirection = MiscGameplayFunctions.GetHeadingVector(m_Player);
210
213
215 rayInput.flags = CollisionFlags.ALLOBJECTS;
216 //rayInput.sorted = true;
218
219 if ( DayZPhysics.RaycastRVProxy(rayInput, results) )
220 {
221 if ( results.Count() > 0 )
222 {
223 array<float> distance_helper = new array<float>;
224 array<float> distance_helper_unsorted = new array<float>;
225 float distance;
226
227 for (i = 0; i < results.Count(); i++)
228 {
229 distance = vector.DistanceSq(results[i].pos, m_RayStart);
230 distance_helper.Insert(distance);
231 //Print("#" + i + " " + results.Get(i).obj);
232 }
233 //Print("--------------");
234 distance_helper_unsorted.Copy(distance_helper);
235 distance_helper.Sort();
236
237 RaycastRVResult res;
238
239
240 for ( i = 0; i < results.Count(); i++)
241 {
242 res = results.Get(distance_helper_unsorted.Find(distance_helper[i])); //closest object
243
244 cursorTarget = res.obj;
245 Class.CastTo(cursorTargetEntity,cursorTarget);
246 if (cursorTarget && !cursorTarget.CanBeActionTarget())
247 continue;
249 if ( res.hierLevel > 0 )
250 {
252 if ( !res.parent.IsMan() )
253 {
254 m_VicinityObjects.StoreVicinityObject(res.obj, res.parent);
255 //Print("storing, 1st pass (hier > 0): " + res.obj);
256 }
257 else
258 continue;
259 }
260 else
261 {
262 m_VicinityObjects.StoreVicinityObject(res.obj, null);
263 //Print("storing, 1st pass: " + res.obj);
264 }
265
266 m_HitPos = res.pos;
267 hitComponentIndex = res.component;
268 break;
269 }
270 }
271 //else
272 //Print("NO RESULTS FOUND!");
273 }
274 else
275 {
276 //Print("CAST UNSUCCESFUL");
277 cursorTarget = null;
279 hitComponentIndex = -1;
280 }
281
282 //Print(cursorTarget);
283
285 DayZPlayerCamera camera = m_Player.GetCurrentCamera();
286 if (camera && camera.GetCurrentPitch() <= -45) // Spatial search is a contributor to very heavy searching, limit it to when we are at least looking down
287 DayZPlayerUtils.GetEntitiesInCone(playerPos, headingDirection, c_ConeAngle, c_MaxTargetDistance, c_ConeHeightMin, c_ConeHeightMax, vicinityObjects);
288
290 vicinityObjects.RemoveItem(m_Player);
291
293 //Print("m_VicinityObjects before" + m_VicinityObjects.Count());
294 m_VicinityObjects.TransformToVicinityObjects(vicinityObjects);
295 //Print("m_VicinityObjects after" + m_VicinityObjects.Count());
296
298 FilterObstructedObjectsEx(cursorTarget, vicinityObjects);
299
301 for ( i = 0; i < m_VicinityObjects.Count(); i++ )
302 {
303 Object object = m_VicinityObjects.GetObject(i);
304 Object parent = m_VicinityObjects.GetParent(i);
305
306 float utility = ComputeUtility(object, m_RayStart, m_RayEnd, cursorTarget, m_HitPos);
307 if ( utility > 0 )
308 {
309 int targetComponent = -1;
310 targetComponent = hitComponentIndex;
311
312 ActionTarget at = new ActionTarget(object, parent, targetComponent, m_HitPos, utility);
313 StoreTarget(at);
314 }
315 /*else
316 Print("utility < 0; object: " + object + " | parent: " + parent);*/
317 }
318
320 if (m_HitPos == vector.Zero)
321 {
322 vector contact_pos, contact_dir, hitNormal;
323 int contactComponent;
324 float hitFraction;
325 Object hitObject;
326
328
329 PhxInteractionLayers collisionLayerMask = PhxInteractionLayers.ROADWAY|PhxInteractionLayers.TERRAIN|PhxInteractionLayers.WATERLAYER;
330 DayZPhysics.RayCastBullet(m_RayStart,m_RayEnd,collisionLayerMask,null,hitObject,contact_pos,hitNormal,hitFraction);
331 m_HitPos = contact_pos;
332 }
333
334 m_Targets.Insert(new ActionTarget(null, null, -1, m_HitPos, 0));
335
336#ifdef DIAG_DEVELOPER
337 if (DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_DEBUG))
338 {
339 ShowDebugActionTargets(true);
340 DrawDebugActionTargets(true);
341 DrawDebugCone(true);
342 DrawDebugRay(true);
343 DrawSelectionPos(DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_SELPOS_DEBUG));
344 }
345 else
346 {
347 ShowDebugActionTargets(false);
348 DrawDebugActionTargets(false);
349 DrawDebugCone(false);
350 DrawDebugRay(false);
351 DrawSelectionPos(false);
352 }
353#endif
354 //Print("--------------");
355 }
356
357 private bool IsObstructed(Object object)
358 {
360 return IsObstructedEx(object, cache);
361 }
362
364 {
365 return MiscGameplayFunctions.IsObjectObstructedEx(object, cache);
366 }
367
370 { return m_Targets.Count(); }
371
374 { return m_Targets.Get(index); }
375
377 private void StoreTarget(ActionTarget pActionTarget)
378 {
379 int index = FindIndexForStoring(pActionTarget.GetUtility());
380 m_Targets.InsertAt(pActionTarget, index);
381 //Print("StoreTarget; object: " + pActionTarget.GetObject() + " | parent: " + pActionTarget.GetParent() + " | idx: " + index);
382 }
383
385 private int FindIndexForStoring(float value)
386 {
387 int left = 0;
388 int right = m_Targets.Count() - 1;
389 while ( left <= right )
390 {
391 int middle = (left + right) / 2;
392 float middleValue = m_Targets.Get(middle).GetUtility();
393
394 if ( middleValue == value )
395 return middle;
396 else if ( middleValue < value )
397 right = middle - 1;
398 else
399 left = middle + 1;
400 }
401
402 return left;
403 }
404
406 private float ComputeUtility(Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos)
407 {
410 return -1;
411
412 if (pTarget)
413 {
414 if ( pTarget == cursorTarget )
415 {
417 if ( pTarget.GetType() == string.Empty )
418 return 0.01;
419
420 if ( pTarget.IsBuilding() )
421 return 0.25;
422
423 if ( pTarget.IsTransport() )
424 return 0.25;
425
426 if ( pTarget.IsWell() )
427 return 0.9;
428
429 vector playerPosXZ = m_Player.GetPosition();
430 vector hitPosXZ = hitPos;
431 playerPosXZ[1] = 0;
432 hitPosXZ[1] = 0;
433 if ( vector.DistanceSq(playerPosXZ, hitPosXZ) <= c_MaxTargetDistance * c_MaxTargetDistance )
434 return c_UtilityMaxValue;
435 }
436
437 float distSqr = DistSqrPoint2Line(pTarget.GetPosition(), pRayStart, pRayEnd);
439 }
440
441 return -1;
442 }
443
445 private float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
446 {
447 vector v = pL2 - pL1;
448 vector w = pPoint - pL1;
449
450 float c1 = vector.Dot(w,v);
451 float c2 = vector.Dot(v,v);
452
453 if ( c1 <= 0 || c2 == 0 )
454 return vector.DistanceSq(pPoint, pL1);
455
456 float b = c1 / c2;
457 vector nearestPoint = pL1 + (v * b);
458 return vector.DistanceSq(pPoint, nearestPoint);
459 }
460
461 private void FilterObstructedObjectsEx(Object cursor_target, array<Object> vicinityObjects)
462 {
463 #ifdef DIAG_DEVELOPER
464 if (DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_DEBUG))
465 CleanupDebugShapes(obstruction);
466 #endif
467
468 array<Object> obstructingObjects = new array<Object>;
469 MiscGameplayFunctions.FilterObstructingObjects(vicinityObjects, obstructingObjects);
470
471 if ( obstructingObjects.Count() > 0 )
472 {
473 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
474
475 int numObstructed = 0;
476 int mCount = m_VicinityObjects.Count();
477
478 if (mCount > GROUPING_COUNT_THRESHOLD)
479 {
480 array<Object> filteredObjects = new array<Object>;
481 MiscGameplayFunctions.FilterObstructedObjectsByGrouping(m_RayStart, c_MaxTargetDistance, c_DistanceDelta, m_VicinityObjects.GetRawVicinityObjects(), vicinityObjects, filteredObjects);
482 m_VicinityObjects.ClearVicinityObjects();
483 m_VicinityObjects.TransformToVicinityObjects(filteredObjects);
484 }
485 else
486 {
487 FilterObstructedObjects(cursor_target);
488 }
489 }
490 }
491
492 private void FilterObstructedObjects(Object cursor_target)
493 {
494 int numObstructed = 0;
495 int mCount = m_VicinityObjects.Count();
497 mCount--;
498
500 for ( int i = mCount; i >= 0; --i )
501 {
502 Object object = m_VicinityObjects.GetObject(i);
503 Object parent = m_VicinityObjects.GetParent(i);
504
506 if (object && !parent)
507 {
510 if (numObstructed > OBSTRUCTED_COUNT_THRESHOLD && object != cursor_target)
511 {
512 m_VicinityObjects.Remove(object);
513 continue;
514 }
515
517 if (object != cursor_target && IsObstructedEx(object, cache))
518 {
519 m_VicinityObjects.Remove(object);
520 numObstructed++;
521 }
522
523 cache.ClearCache();
524 }
525 }
526 }
527
528#ifdef DIAG_DEVELOPER
529 ref array<Shape> shapes = new array<Shape>();
530 ref array<Shape> dbgConeShapes = new array<Shape>();
531 ref array<Shape> rayShapes = new array<Shape>();
532 ref array<Shape> obstruction = new array<Shape>();
533 ref array<Shape> dbgPosShapes = new array<Shape>();
534
535 void ShowDebugActionTargets(bool enabled)
536 {
537 int windowPosX = 0;
538 int windowPosY = 50;
539
540 Object obj;
541
543 DbgUI.Begin("Action Targets", windowPosX, windowPosY);
544 if ( enabled )
545 {
546 for ( int i = 0; i < GetTargetsCount(); i++ )
547 {
548 obj = m_Targets.Get(i).GetObject();
549 if ( obj )
550 {
551 float util = m_Targets.Get(i).GetUtility();
552 int compIdx = m_Targets.Get(i).GetComponentIndex();
553 string compName;
554 array<string> compNames = new array<string>;
555 compName = obj.GetActionComponentName(compIdx);
556 obj.GetActionComponentNameList(compIdx, compNames);
557
558 if ( compNames.Count() > 0 )
559 {
560 for ( int c = 0; c < compNames.Count(); c++ )
561 {
562 DbgUI.Text(obj.GetDisplayName() + " :: " + obj + " | util: " + util + " | compIdx: " + compIdx + " | compName: " + compNames[c] + "| wPos: " + obj.GetWorldPosition() );
563 }
564 }
565 else
566 {
567 DbgUI.Text(obj.GetDisplayName() + " :: " + obj + " | util: " + util + " | compIdx: " + compIdx + " | compName: " + compName + "| wPos: " + obj.GetWorldPosition() );
568 }
569 }
570 else
571 continue;
572 }
573 }
574 DbgUI.End();
576 }
577
578 void DrawDebugActionTargets(bool enabled)
579 {
580 int s_id;
581 vector w_pos;
582 vector w_pos_sphr;
583 vector w_pos_lend;
584 Object obj;
585
586 if ( enabled )
587 {
588 CleanupDebugShapes(shapes);
589
590 for ( int i = 0; i < GetTargetsCount(); i++ )
591 {
592 obj = m_Targets.Get(i).GetObject();
593 if ( obj )
594 {
595 w_pos = obj.GetPosition();
596 // sphere pos tweaks
597 w_pos_sphr = w_pos;
598 w_pos_sphr[1] = w_pos_sphr[1] + 0.5;
599 // line pos tweaks
600 w_pos_lend = w_pos;
601 w_pos_lend[1] = w_pos_lend[1] + 0.5;
602
603 if ( i == 0 )
604 {
605 shapes.Insert( Debug.DrawSphere(w_pos_sphr, 0.03, COLOR_RED) );
606 shapes.Insert( Debug.DrawLine(w_pos, w_pos_lend, COLOR_RED) );
607 }
608 else
609 {
610 shapes.Insert( Debug.DrawSphere(w_pos_sphr, 0.03, COLOR_YELLOW) );
611 shapes.Insert( Debug.DrawLine(w_pos, w_pos_lend, COLOR_YELLOW) );
612 }
613 }
614 }
615 }
616 else
617 CleanupDebugShapes(shapes);
618 }
619
620 private void DrawDebugCone(bool enabled)
621 {
622 // "cone" settings
623 vector start, end, endL, endR;
624 float playerAngle;
625 float xL,xR,zL,zR;
626
627 if (enabled)
628 {
629 CleanupDebugShapes(dbgConeShapes);
630
631 start = m_Player.GetPosition();
632 playerAngle = MiscGameplayFunctions.GetHeadingAngle(m_Player);
633
634 // offset position of the shape in height
635 start[1] = start[1] + 0.2;
636
637 endL = start;
638 endR = start;
639 xL = c_MaxTargetDistance * Math.Cos(playerAngle + Math.PI_HALF + c_ConeAngle * Math.DEG2RAD); // x
640 zL = c_MaxTargetDistance * Math.Sin(playerAngle + Math.PI_HALF + c_ConeAngle * Math.DEG2RAD); // z
641 xR = c_MaxTargetDistance * Math.Cos(playerAngle + Math.PI_HALF - c_ConeAngle * Math.DEG2RAD); // x
642 zR = c_MaxTargetDistance * Math.Sin(playerAngle + Math.PI_HALF - c_ConeAngle * Math.DEG2RAD); // z
643 endL[0] = endL[0] + xL;
644 endL[2] = endL[2] + zL;
645 endR[0] = endR[0] + xR;
646 endR[2] = endR[2] + zR;
647
648 dbgConeShapes.Insert( Debug.DrawLine(start, endL, COLOR_BLUE) );
649 dbgConeShapes.Insert( Debug.DrawLine(start, endR, COLOR_BLUE) ) ;
650 dbgConeShapes.Insert( Debug.DrawLine(endL, endR, COLOR_BLUE) );
651 }
652 else
653 CleanupDebugShapes(dbgConeShapes);
654 }
655
656 private void DrawSelectionPos(bool enabled)
657 {
658 if (enabled)
659 {
660 CleanupDebugShapes(dbgPosShapes);
661 if (GetTargetsCount() > 0 && GetTarget(0).GetUtility() > -1 )
662 {
663 ActionTarget at = GetTarget(0);
664 if (at.GetObject())
665 {
666 string compName = at.GetObject().GetActionComponentName(at.GetComponentIndex());
667 vector modelPos = at.GetObject().GetSelectionPositionMS(compName);
668 vector worldPos = at.GetObject().ModelToWorld(modelPos);
669 dbgPosShapes.Insert( Debug.DrawSphere(worldPos, 0.25, Colors.PURPLE, ShapeFlags.NOZBUFFER) );
670 }
671 }
672 }
673 else
674 CleanupDebugShapes(dbgPosShapes);
675 }
676
677 private void DrawDebugRay(bool enabled)
678 {
679 if (enabled)
680 {
681 CleanupDebugShapes(rayShapes);
683 rayShapes.Insert( Debug.DrawLine(m_RayStart, m_RayEnd, COLOR_BLUE) );
684 }
685 else
686 CleanupDebugShapes(rayShapes);
687 }
688
689 private void CleanupDebugShapes(array<Shape> shapesArr)
690 {
691 for ( int it = 0; it < shapesArr.Count(); ++it )
692 {
693 Debug.RemoveShape( shapesArr[it] );
694 }
695
696 shapesArr.Clear();
697 }
698#endif
699
700 //--------------------------------------------------------
701 // Members
702 //--------------------------------------------------------
705
708
710 static private ref VicinityObjects m_VicinityObjects
711
712 private bool m_Debug
713
717
718 //--------------------------------------------------------
719 // Constants
720 //--------------------------------------------------------
722 private const float c_RayDistance = 5.0;
723 private const float c_MaxTargetDistance = 3.0;
725 private const float c_ConeAngle = 30.0;
726 private const float c_ConeHeightMin = -0.5;
727 private const float c_ConeHeightMax = 2.0;
728 private const float c_DistanceDelta = 0.3;
729
731 private const float c_UtilityMaxValue = 10000;
732 private const float c_UtilityMaxDistFromRaySqr = 0.8 * 0.8;
733
735 private const string CE_CENTER = "ce_center";
736 private const float HEIGHT_OFFSET = 0.2;
737
739 private const int OBSTRUCTED_COUNT_THRESHOLD = 3;
740 private const int GROUPING_COUNT_THRESHOLD = 10;
741
745
747{
749}
eBleedingSourceType GetType()
void DbgPrintTargetDump()
class ActionTargets ActionTarget
private vector m_CursorHitPos
private ref map< Object, Object > m_VicinityObjects
private float m_Utility
vector GetCursorHitPos()
Object GetObject()
float GetUtility()
private Object m_Object
void SetCursorHitPos(vector cursor_position)
DayZGame g_Game
Definition DayZGame.c:3654
proto native int GetComponentIndex()
PhxInteractionLayers
Definition DayZPhysics.c:2
private void DayZPlayerUtils()
cannot be instantiated
DiagMenuIDs
Definition EDiagMenuIDs.c:2
string DumpToString()
bool IsProxy()
Definition Hand_Events.c:58
int m_ComponentIndex
void IsObjectObstructedCache(vector rayCastStart, int totalObjects)
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int windowPosY
protected Widget m_Parent
Definition SizeToChild.c:92
protected bool m_Debug
override bool CanBeActionTarget()
Definition WoodBase.c:246
void ActionTargets(PlayerBase player)
private const float c_ConeHeightMax
private const float c_UtilityMaxValue
utility constants
private const float HEIGHT_OFFSET
private const int OBSTRUCTED_COUNT_THRESHOLD
misc
private const int GROUPING_COUNT_THRESHOLD
private const float c_MaxActionDistance
private PlayerBase m_Player
player owner
private void StoreTarget(ActionTarget pActionTarget)
inserts action into sorted array based on utility
private const float c_RayDistance
searching properties
private void FilterObstructedObjectsEx(Object cursor_target, array< Object > vicinityObjects)
private const float c_UtilityMaxDistFromRaySqr
private vector m_RayEnd
private const float c_ConeHeightMin
vector CalculateRayStart()
DEPRECATED.
private const float c_MaxTargetDistance
private const string CE_CENTER
p3d
private void FilterObstructedObjects(Object cursor_target)
int GetTargetsCount()
returns count of founded targets
ActionTarget GetTarget(int index)
returns action target at index
static private ref VicinityObjects m_VicinityObjects private bool m_Debug private vector m_RayStart
objects in vicinity
static array< Object > GetVicinityObjects()
private bool IsObstructed(Object object)
private bool IsObstructedEx(Object object, IsObjectObstructedCache cache)
private ref array< ref ActionTarget > m_Targets
selected & sorted targets by utility function
private vector m_HitPos
private const float c_DistanceDelta
private float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
distance between point and line
private int FindIndexForStoring(float value)
binary search algorithm
private float ComputeUtility(Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos)
computes utility of target
private const float c_ConeAngle
proto native vector GetCurrentCameraDirection()
proto native vector GetCurrentCameraPosition()
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Colors.c:4
const int PURPLE
Definition Colors.c:9
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
Definition DbgUI.c:60
Definition Debug.c:14
static void RemoveShape(out Shape shape)
Definition Debug.c:107
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:361
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Definition Debug.c:306
override bool IsTakeable()
Definition EnMath.c:7
ref array< Object > Objects
CollisionFlags flags
Definition DayZPhysics.c:60
vector pos
position of collision (in world coord)
Object obj
object,that we collide with (NULL if none), If hierLevel > 0 object is the proxy object
Definition DayZPhysics.c:97
int component
index of component in corresponding geometry level
Object parent
if hierLevel > 0 most parent of the proxy object
Definition DayZPhysics.c:98
int hierLevel
which hierarchy level is the collision detected at, == 0 = objects in landscape, > 0 = proxy
const float DEFAULT
objects in vicinity - extended with secondary object which is parent of that Object
void VicinityObjects()
void TransformToVicinityObjects(array< Object > objects)
transform simple array of Objects to VicinityObjects hashmap
void Remove(Object object)
private ref map< Object, Object > m_VicinityObjects
array< Object > GetVicinityObjects()
return simple array of Objects in Vicinity
Object GetObject(int i)
returns VicinityObjects Key
void StoreVicinityObject(Object object, Object parent=null)
stores VicinityObject to Hashmap - for storing of parent/child relationship
void Remove(array< Object > objects)
Object GetParent(int i)
returns VicinityObjects Element
array< Object > GetRawVicinityObjects()
return simple array of Objects in Vicinity
void ClearVicinityObjects()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString()
proto string ToString(bool beautify=true)
Vector to string.
static const vector Zero
Definition EnConvert.c:110
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
Definition dayzplayer.c:56
proto native CGame GetGame()
const int COLOR_BLUE
Definition constants.c:66
const int COLOR_BLUE_A
Definition constants.c:71
const int COLOR_RED
Definition constants.c:64
const int COLOR_YELLOW
Definition constants.c:67
proto void Print(void var)
Prints content of variable to console/log.
CollisionFlags
Definition EnDebug.c:141
ShapeFlags
Definition EnDebug.c:126
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto void BeginCleanupScope()
static proto native void Text(string label)
static proto native void EndCleanupScope()
static proto native void End()
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static const float PI_HALF
Definition EnMath.c:14
static const float DEG2RAD
Definition EnMath.c:17
static proto float Sin(float angle)
Returns sinus of angle in radians.
static proto float Sqrt(float val)
Returns square root.
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:396