DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionTargets.c
См. документацию.
3{
5
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
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
206
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;
278 m_HitPos = vector.Zero;
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
427 if (pTarget.CanUseConstruction())
428 return 0.85;
429
430 if ( pTarget.IsWell() )
431 return 0.9;
432
433 vector playerPosXZ = m_Player.GetPosition();
434 vector hitPosXZ = hitPos;
435 playerPosXZ[1] = 0;
436 hitPosXZ[1] = 0;
437 if ( vector.DistanceSq(playerPosXZ, hitPosXZ) <= c_MaxTargetDistance * c_MaxTargetDistance )
438 return c_UtilityMaxValue;
439 }
440
441 if ( PlayerBase.Cast(pTarget) && PlayerBase.Cast(pTarget).IsInVehicle() ) // utility in vehicle should be below base vehicle val
442 return 0.20;
443
444 float distSqr = DistSqrPoint2Line(pTarget.GetPosition(), pRayStart, pRayEnd);
446 }
447
448 return -1;
449 }
450
452 private float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
453 {
454 vector v = pL2 - pL1;
455 vector w = pPoint - pL1;
456
457 float c1 = vector.Dot(w,v);
458 float c2 = vector.Dot(v,v);
459
460 if ( c1 <= 0 || c2 == 0 )
461 return vector.DistanceSq(pPoint, pL1);
462
463 float b = c1 / c2;
464 vector nearestPoint = pL1 + (v * b);
465 return vector.DistanceSq(pPoint, nearestPoint);
466 }
467
468 private void FilterObstructedObjectsEx(Object cursor_target, array<Object> vicinityObjects)
469 {
470 #ifdef DIAG_DEVELOPER
471 if (DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_DEBUG))
472 CleanupDebugShapes(obstruction);
473 #endif
474
475 array<Object> obstructingObjects = new array<Object>;
476 MiscGameplayFunctions.FilterObstructingObjects(vicinityObjects, obstructingObjects);
477
478 if ( obstructingObjects.Count() > 0 )
479 {
480 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
481
482 int numObstructed = 0;
483 int mCount = m_VicinityObjects.Count();
484
485 if (mCount > GROUPING_COUNT_THRESHOLD)
486 {
487 array<Object> filteredObjects = new array<Object>;
488 MiscGameplayFunctions.FilterObstructedObjectsByGrouping(m_RayStart, c_MaxTargetDistance, c_DistanceDelta, m_VicinityObjects.GetRawVicinityObjects(), vicinityObjects, filteredObjects);
489 m_VicinityObjects.ClearVicinityObjects();
490 m_VicinityObjects.TransformToVicinityObjects(filteredObjects);
491 }
492 else
493 {
494 FilterObstructedObjects(cursor_target);
495 }
496 }
497 }
498
499 private void FilterObstructedObjects(Object cursor_target)
500 {
501 int numObstructed = 0;
502 int mCount = m_VicinityObjects.Count();
504 mCount--;
505
507 for ( int i = mCount; i >= 0; --i )
508 {
509 Object object = m_VicinityObjects.GetObject(i);
510 Object parent = m_VicinityObjects.GetParent(i);
511
513 if (object && !parent)
514 {
517 if (numObstructed > OBSTRUCTED_COUNT_THRESHOLD && object != cursor_target)
518 {
519 m_VicinityObjects.Remove(object);
520 continue;
521 }
522
524 if (object != cursor_target && IsObstructedEx(object, cache))
525 {
526 m_VicinityObjects.Remove(object);
527 numObstructed++;
528 }
529
530 cache.ClearCache();
531 }
532 }
533 }
534
535#ifdef DIAG_DEVELOPER
536 ref array<Shape> shapes = new array<Shape>();
537 ref array<Shape> dbgConeShapes = new array<Shape>();
538 ref array<Shape> rayShapes = new array<Shape>();
539 ref array<Shape> obstruction = new array<Shape>();
540 ref array<Shape> dbgPosShapes = new array<Shape>();
541
542 void ShowDebugActionTargets(bool enabled)
543 {
544 int windowPosX = 0;
545 int windowPosY = 50;
546
547 Object obj;
548
550 DbgUI.Begin("Action Targets", windowPosX, windowPosY);
551 if ( enabled )
552 {
553 for ( int i = 0; i < GetTargetsCount(); i++ )
554 {
555 obj = m_Targets.Get(i).GetObject();
556 if ( obj )
557 {
558 float util = m_Targets.Get(i).GetUtility();
559 int compIdx = m_Targets.Get(i).GetComponentIndex();
560 string compName;
561 array<string> compNames = new array<string>;
562 compName = obj.GetActionComponentName(compIdx);
563 obj.GetActionComponentNameList(compIdx, compNames);
564
565 if ( compNames.Count() > 0 )
566 {
567 for ( int c = 0; c < compNames.Count(); c++ )
568 {
569 DbgUI.Text(obj.GetDisplayName() + " :: " + obj + " | util: " + util + " | compIdx: " + compIdx + " | compName: " + compNames[c] + "| wPos: " + obj.GetWorldPosition() );
570 }
571 }
572 else
573 {
574 DbgUI.Text(obj.GetDisplayName() + " :: " + obj + " | util: " + util + " | compIdx: " + compIdx + " | compName: " + compName + "| wPos: " + obj.GetWorldPosition() );
575 }
576 }
577 else
578 continue;
579 }
580 }
581 DbgUI.End();
582 DbgUI.EndCleanupScope();
583 }
584
585 void DrawDebugActionTargets(bool enabled)
586 {
587 int s_id;
588 vector w_pos;
589 vector w_pos_sphr;
590 vector w_pos_lend;
591 Object obj;
592
593 if ( enabled )
594 {
595 CleanupDebugShapes(shapes);
596
597 for ( int i = 0; i < GetTargetsCount(); i++ )
598 {
599 obj = m_Targets.Get(i).GetObject();
600 if ( obj )
601 {
602 w_pos = obj.GetPosition();
603 // sphere pos tweaks
604 w_pos_sphr = w_pos;
605 w_pos_sphr[1] = w_pos_sphr[1] + 0.5;
606 // line pos tweaks
607 w_pos_lend = w_pos;
608 w_pos_lend[1] = w_pos_lend[1] + 0.5;
609
610 if ( i == 0 )
611 {
612 shapes.Insert( Debug.DrawSphere(w_pos_sphr, 0.03, COLOR_RED) );
613 shapes.Insert( Debug.DrawLine(w_pos, w_pos_lend, COLOR_RED) );
614 }
615 else
616 {
617 shapes.Insert( Debug.DrawSphere(w_pos_sphr, 0.03, COLOR_YELLOW) );
618 shapes.Insert( Debug.DrawLine(w_pos, w_pos_lend, COLOR_YELLOW) );
619 }
620 }
621 }
622 }
623 else
624 CleanupDebugShapes(shapes);
625 }
626
627 private void DrawDebugCone(bool enabled)
628 {
629 // "cone" settings
630 vector start, end, endL, endR;
631 float playerAngle;
632 float xL,xR,zL,zR;
633
634 if (enabled)
635 {
636 CleanupDebugShapes(dbgConeShapes);
637
638 start = m_Player.GetPosition();
639 playerAngle = MiscGameplayFunctions.GetHeadingAngle(m_Player);
640
641 // offset position of the shape in height
642 start[1] = start[1] + 0.2;
643
644 endL = start;
645 endR = start;
646 xL = c_MaxTargetDistance * Math.Cos(playerAngle + Math.PI_HALF + c_ConeAngle * Math.DEG2RAD); // x
647 zL = c_MaxTargetDistance * Math.Sin(playerAngle + Math.PI_HALF + c_ConeAngle * Math.DEG2RAD); // z
648 xR = c_MaxTargetDistance * Math.Cos(playerAngle + Math.PI_HALF - c_ConeAngle * Math.DEG2RAD); // x
649 zR = c_MaxTargetDistance * Math.Sin(playerAngle + Math.PI_HALF - c_ConeAngle * Math.DEG2RAD); // z
650 endL[0] = endL[0] + xL;
651 endL[2] = endL[2] + zL;
652 endR[0] = endR[0] + xR;
653 endR[2] = endR[2] + zR;
654
655 dbgConeShapes.Insert( Debug.DrawLine(start, endL, COLOR_BLUE) );
656 dbgConeShapes.Insert( Debug.DrawLine(start, endR, COLOR_BLUE) ) ;
657 dbgConeShapes.Insert( Debug.DrawLine(endL, endR, COLOR_BLUE) );
658 }
659 else
660 CleanupDebugShapes(dbgConeShapes);
661 }
662
663 private void DrawSelectionPos(bool enabled)
664 {
665 if (enabled)
666 {
667 CleanupDebugShapes(dbgPosShapes);
668 if (GetTargetsCount() > 0 && GetTarget(0).GetUtility() > -1 )
669 {
670 ActionTarget at = GetTarget(0);
671 if (at.GetObject())
672 {
673 string compName = at.GetObject().GetActionComponentName(at.GetComponentIndex());
674 vector modelPos = at.GetObject().GetSelectionPositionMS(compName);
675 vector worldPos = at.GetObject().ModelToWorld(modelPos);
676 dbgPosShapes.Insert( Debug.DrawSphere(worldPos, 0.25, Colors.PURPLE, ShapeFlags.NOZBUFFER) );
677 }
678 }
679 }
680 else
681 CleanupDebugShapes(dbgPosShapes);
682 }
683
684 private void DrawDebugRay(bool enabled)
685 {
686 if (enabled)
687 {
688 CleanupDebugShapes(rayShapes);
689 rayShapes.Insert( Debug.DrawSphere(m_HitPos, Math.Sqrt(c_UtilityMaxDistFromRaySqr), COLOR_BLUE_A, ShapeFlags.TRANSP) );
690 rayShapes.Insert( Debug.DrawLine(m_RayStart, m_RayEnd, COLOR_BLUE) );
691 }
692 else
693 CleanupDebugShapes(rayShapes);
694 }
695
696 private void CleanupDebugShapes(array<Shape> shapesArr)
697 {
698 for ( int it = 0; it < shapesArr.Count(); ++it )
699 {
700 Debug.RemoveShape( shapesArr[it] );
701 }
702
703 shapesArr.Clear();
704 }
705#endif
706
707 //--------------------------------------------------------
708 // Members
709 //--------------------------------------------------------
712
715
717 static private ref VicinityObjects m_VicinityObjects
718
719 private bool m_Debug
720
724
725 //--------------------------------------------------------
726 // Constants
727 //--------------------------------------------------------
729 private const float c_RayDistance = 5.0;
730 private const float c_MaxTargetDistance = 3.0;
732 private const float c_ConeAngle = 30.0;
733 private const float c_ConeHeightMin = -0.5;
734 private const float c_ConeHeightMax = 2.0;
735 private const float c_DistanceDelta = 0.3;
736
738 private const float c_UtilityMaxValue = 10000;
739 private const float c_UtilityMaxDistFromRaySqr = 0.8 * 0.8;
740
742 private const string CE_CENTER = "ce_center";
743 private const float HEIGHT_OFFSET = 0.2;
744
746 private const int OBSTRUCTED_COUNT_THRESHOLD = 3;
747 private const int GROUPING_COUNT_THRESHOLD = 10;
748
752
eBleedingSourceType GetType()
Определения BleedingSource.c:63
Object m_Object
Определения ActionPushObject.c:12
void DbgPrintTargetDump()
Определения ActionTargets.c:149
class ActionTargets ActionTarget
float m_Utility
Определения ActionTargets.c:170
ref map< Object, Object > m_VicinityObjects
Определения ActionTargets.c:114
vector GetCursorHitPos()
Определения ActionTargets.c:141
Object GetObject()
Определения ActionTargets.c:122
vector m_CursorHitPos
Определения ActionTargets.c:169
float GetUtility()
Определения ActionTargets.c:138
void SetCursorHitPos(vector cursor_position)
Определения ActionTargets.c:144
map
Определения ControlsXboxNew.c:4
DayZGame g_Game
Определения DayZGame.c:3868
proto native int GetComponentIndex()
Определения ActionTargets.c:135
PhxInteractionLayers
Определения DayZPhysics.c:2
vector m_RayStart
Start position of most recent HitZoneSelectionRaycast.
vector m_RayEnd
End position of most recent HitZoneSelectionRaycast.
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
DiagMenuIDs
Определения EDiagMenuIDs.c:2
DayZPlayer m_Player
Определения Hand_Events.c:42
string DumpToString()
Определения Hand_Events.c:165
bool IsProxy()
Определения Hand_Events.c:65
int m_ComponentIndex
Определения ImpactEffects.c:14
void IsObjectObstructedCache(vector rayCastStart, int totalObjects)
Определения MiscGameplayFunctions.c:1937
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int windowPosY
Определения PluginPresenceNotifier.c:77
Widget m_Parent
Определения SizeToChild.c:92
void Debug()
Определения UniversalTemperatureSource.c:349
override bool CanBeActionTarget()
Определения WoodBase.c:256
const float c_UtilityMaxDistFromRaySqr
Определения ActionTargets.c:739
const float c_MaxTargetDistance
Определения ActionTargets.c:730
vector m_RayEnd
Определения ActionTargets.c:722
const float c_DistanceDelta
Определения ActionTargets.c:735
int GetTargetsCount()
returns count of founded targets
Определения ActionTargets.c:369
const string CE_CENTER
p3d
Определения ActionTargets.c:742
const float HEIGHT_OFFSET
Определения ActionTargets.c:743
static array< Object > GetVicinityObjects()
Определения ActionTargets.c:184
const float c_ConeAngle
Определения ActionTargets.c:732
const int OBSTRUCTED_COUNT_THRESHOLD
misc
Определения ActionTargets.c:746
void Update()
Определения ActionTargets.c:194
void FilterObstructedObjects(Object cursor_target)
Определения ActionTargets.c:499
const float c_MaxActionDistance
Определения ActionTargets.c:731
bool IsObstructedEx(Object object, IsObjectObstructedCache cache)
Определения ActionTargets.c:363
bool IsObstructed(Object object)
Определения ActionTargets.c:357
float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
distance between point and line
Определения ActionTargets.c:452
vector m_HitPos
Определения ActionTargets.c:723
void StoreTarget(ActionTarget pActionTarget)
inserts action into sorted array based on utility
Определения ActionTargets.c:377
const float c_RayDistance
searching properties
Определения ActionTargets.c:729
PlayerBase m_Player
player owner
Определения ActionTargets.c:711
ActionTarget GetTarget(int index)
returns action target at index
Определения ActionTargets.c:373
void FilterObstructedObjectsEx(Object cursor_target, array< Object > vicinityObjects)
Определения ActionTargets.c:468
void ActionTargets(PlayerBase player)
Определения ActionTargets.c:175
void Clear()
Определения ActionTargets.c:189
const int GROUPING_COUNT_THRESHOLD
Определения ActionTargets.c:747
vector CalculateRayStart()
DEPRECATED.
vector m_RayStart
objects in vicinity
Определения ActionTargets.c:721
ref array< ref ActionTarget > m_Targets
selected & sorted targets by utility function
Определения ActionTargets.c:714
float ComputeUtility(Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos)
computes utility of target
Определения ActionTargets.c:406
const float c_UtilityMaxValue
utility constants
Определения ActionTargets.c:738
int FindIndexForStoring(float value)
binary search algorithm
Определения ActionTargets.c:385
const float c_ConeHeightMax
Определения ActionTargets.c:734
const float c_ConeHeightMin
Определения ActionTargets.c:733
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
Определения DayZPhysics.c:124
Определения DbgUI.c:60
Определения EnDebug.c:233
Определения Building.c:6
override bool IsTakeable()
Определения BaseBuildingBase.c:988
Определения InventoryItem.c:731
ref array< Object > Objects
Определения ActionTargets.c:755
Определения ActionTargets.c:754
Определения ObjectTyped.c:2
Определения PlayerBaseClient.c:2
CollisionFlags flags
Определения DayZPhysics.c:63
Определения DayZPhysics.c:50
Object obj
object,that we collide with (NULL if none), If hierLevel > 0 object is the proxy object
Определения DayZPhysics.c:100
int component
index of component in corresponding geometry level
Определения DayZPhysics.c:107
int hierLevel
which hierarchy level is the collision detected at, == 0 = objects in landscape, > 0 = proxy
Определения DayZPhysics.c:106
vector pos
position of collision (in world coord)
Определения DayZPhysics.c:103
Object parent
if hierLevel > 0 most parent of the proxy object
Определения DayZPhysics.c:101
const float DEFAULT
Определения ActionConstants.c:112
void Remove(Object object)
Определения ActionTargets.c:97
int Count()
Определения ActionTargets.c:92
void Remove(array< Object > objects)
Определения ActionTargets.c:102
void ClearVicinityObjects()
Определения ActionTargets.c:46
Object GetObject(int i)
returns VicinityObjects Key
Определения ActionTargets.c:81
void TransformToVicinityObjects(array< Object > objects)
transform simple array of Objects to VicinityObjects hashmap
Определения ActionTargets.c:34
ref map< Object, Object > m_VicinityObjects
Определения ActionTargets.c:4
Object GetParent(int i)
returns VicinityObjects Element
Определения ActionTargets.c:87
void VicinityObjects()
Определения ActionTargets.c:6
void StoreVicinityObject(Object object, Object parent=null)
stores VicinityObject to Hashmap - for storing of parent/child relationship
Определения ActionTargets.c:12
array< Object > GetRawVicinityObjects()
return simple array of Objects in Vicinity
Определения ActionTargets.c:69
array< Object > GetVicinityObjects()
return simple array of Objects in Vicinity
Определения ActionTargets.c:52
objects in vicinity - extended with secondary object which is parent of that Object
Определения ActionTargets.c:3
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
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.
Определения EnConvert.c:271
Определения EnConvert.c:106
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
Определения dayzplayer.c:56
class LOD Object
proto native CGame GetGame()
@ Colors
Определения EnWorld.c:88
const int COLOR_BLUE
Определения constants.c:66
const int COLOR_BLUE_A
Определения constants.c:71
const int COLOR_RED
Определения constants.c:64
const int COLOR_YELLOW
Определения constants.c:67
proto void Print(void var)
Prints content of variable to console/log.
CollisionFlags
Определения EnDebug.c:141
ShapeFlags
Определения EnDebug.c:126
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto void BeginCleanupScope()
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
proto native Widget GetParent()
Get parent of the Effect.
Определения Effect.c:407