DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionTargets.c
См. документацию.
1
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 private Object m_Object; // object itself
114 private Object m_Parent; // null or parent of m_Object
115 private int m_ComponentIndex; // p3d Component ID or -1
117 private float m_Utility;
118 private string m_SurfaceName;
120
121 void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName = "")
122 {
123 m_Object = object;
124 m_Parent = parent;
125 m_ComponentIndex = componentIndex;
126 m_CursorHitPos = cursorHitPos;
127 m_Utility = utility;
128
129 m_SurfaceName = surfaceName;
130 if (m_SurfaceName != "")
131 {
132 SurfaceInfo surfaceInfo = SurfaceInfo.GetByFile(surfaceName);
133 if (surfaceInfo && surfaceInfo.GetLiquidType() != LIQUID_NONE)
134 m_SurfaceLiquidType = surfaceInfo.GetLiquidType();
135 }
136 }
137
139 {
140 return m_Object;
141 }
142
144 {
145 return m_Parent;
146 }
147
148 bool IsProxy()
149 {
150 if (m_Parent)
151 return true;
152 return false;
153 }
154
156 {
157 return m_ComponentIndex;
158 }
159
161 {
162 return m_Utility;
163 }
164
166 {
167 return m_CursorHitPos;
168 }
169
170 void SetCursorHitPos(vector cursor_position)
171 {
172 m_CursorHitPos = cursor_position;
173 }
174
176 {
177 return m_SurfaceName;
178 }
179
181 {
182 return m_SurfaceLiquidType;
183 }
184
186 {
188 }
189
191 {
192 string res = "ActionTarget dump = {";
193 res = res + "m_Object: " + Object.GetDebugName(m_Object);
194 res = res + "; m_Parent: " + Object.GetDebugName(m_Parent);
195 res = res + "; m_ComponentIndex: " + m_ComponentIndex.ToString();
196 res = res + "; m_CursorHitPos: " + m_CursorHitPos.ToString();
197 res = res + "; m_Utility: " + m_Utility.ToString();
198 res = res + "}";
199 return res;
200 }
201};
202
204{
206 {
207 m_Player = player;
208 m_VicinityObjects = new VicinityObjects;
210
211 m_Debug = false;
212 }
213
215 {
216 return m_VicinityObjects.GetVicinityObjects();
217 }
218
219 void Clear()
220 {
221 m_Targets.Clear();
222 }
223
224 void Update()
225 {
226 int i;
227
229 m_VicinityObjects.ClearVicinityObjects();
230 Clear();
231
232 Object cursorTarget = null;
233 EntityAI cursorTargetEntity = null;
234 array<Object> vicinityObjects = new array<Object>;
235
237 int hitComponentIndex;
238 vector playerPos = m_Player.GetPosition();
239 vector headingDirection = MiscGameplayFunctions.GetHeadingVector(m_Player);
240
243
245 rayInput.flags = CollisionFlags.ALLOBJECTS;
246 //rayInput.sorted = true;
248
249 if ( DayZPhysics.RaycastRVProxy(rayInput, results) )
250 {
251 if ( results.Count() > 0 )
252 {
253 array<float> distance_helper = new array<float>;
254 array<float> distance_helper_unsorted = new array<float>;
255 float distance;
256
257 for (i = 0; i < results.Count(); i++)
258 {
259 distance = vector.DistanceSq(results[i].pos, m_RayStart);
260 distance_helper.Insert(distance);
261 //Print("#" + i + " " + results.Get(i).obj);
262 }
263 //Print("--------------");
264 distance_helper_unsorted.Copy(distance_helper);
265 distance_helper.Sort();
266
267 RaycastRVResult res;
268
269 for (i = 0; i < results.Count(); i++)
270 {
271 res = results.Get(distance_helper_unsorted.Find(distance_helper[i])); //closest object
272
273 cursorTarget = res.obj;
274 Class.CastTo(cursorTargetEntity,cursorTarget);
275 if (cursorTarget && !cursorTarget.CanBeActionTarget())
276 continue;
278 if (res.hierLevel > 0)
279 {
281 if (!res.parent.IsMan())
282 {
283 m_VicinityObjects.StoreVicinityObject(res.obj, res.parent);
284 //Print("storing, 1st pass (hier > 0): " + res.obj);
285 }
286 else
287 continue;
288 }
289 else
290 {
291 m_VicinityObjects.StoreVicinityObject(res.obj, null);
292 //Print("storing, 1st pass: " + res.obj);
293 }
294
295 m_HitPos = res.pos;
296 hitComponentIndex = res.component;
297
298 if (res.surface && res.surface.GetSurfaceType() != "")
299 {
301 }
302 else
303 {
306 surfaceParams.type = SurfaceDetectionType.Roadway;
307 surfaceParams.position = m_HitPos;
308 surfaceParams.includeWater = true;
309 surfaceParams.syncMode = UseObjectsMode.NoWait;
310 surfaceParams.rsd = RoadSurfaceDetection.ABOVE;
311
314 if (g_Game.GetSurface(surfaceParams, surfaceResult))
315 {
316 if (surfaceResult && surfaceResult.surface)
317 {
318 m_SurfaceInfo = surfaceResult.surface;
319 }
320 }
321 }
322 break;
323 }
324 }
325 //else
326 //Print("NO RESULTS FOUND!");
327 }
328 else
329 {
330 //Print("CAST UNSUCCESFUL");
331 cursorTarget = null;
333 m_SurfaceInfo = null;
334 hitComponentIndex = -1;
335 }
336
337 //Print(cursorTarget);
338
340 DayZPlayerCamera camera = m_Player.GetCurrentCamera();
341 if (camera && camera.GetCurrentPitch() <= -45) // Spatial search is a contributor to very heavy searching, limit it to when we are at least looking down
342 DayZPlayerUtils.GetEntitiesInCone(playerPos, headingDirection, c_ConeAngle, c_MaxTargetDistance, c_ConeHeightMin, c_ConeHeightMax, vicinityObjects);
343
345 vicinityObjects.RemoveItem(m_Player);
346
348 //Print("m_VicinityObjects before" + m_VicinityObjects.Count());
349 m_VicinityObjects.TransformToVicinityObjects(vicinityObjects);
350 //Print("m_VicinityObjects after" + m_VicinityObjects.Count());
351
353 FilterObstructedObjectsEx(cursorTarget, vicinityObjects);
354
356 for (i = 0; i < m_VicinityObjects.Count(); i++)
357 {
358 Object object = m_VicinityObjects.GetObject(i);
359 Object parent = m_VicinityObjects.GetParent(i);
360
361 float utility = ComputeUtility(object, m_RayStart, m_RayEnd, cursorTarget, m_HitPos, m_SurfaceInfo);
362 if (utility > 0)
363 {
364 int targetComponent = -1;
365 targetComponent = hitComponentIndex;
366
367 string surfaceName;
368 if (m_SurfaceInfo && m_SurfaceInfo.GetEntryName() != "")
369 surfaceName = m_SurfaceInfo.GetEntryName();
370
371 ActionTarget at = new ActionTarget(object, parent, targetComponent, m_HitPos, utility, surfaceName);
372 StoreTarget(at);
373 }
374 /*else
375 Print("utility < 0; object: " + object + " | parent: " + parent);*/
376 }
377
379 if (m_HitPos == vector.Zero)
380 {
381 vector contact_pos, contact_dir, hitNormal;
382 int contactComponent;
383 float hitFraction;
384 Object hitObject;
385
387
388 PhxInteractionLayers collisionLayerMask = PhxInteractionLayers.ROADWAY|PhxInteractionLayers.TERRAIN|PhxInteractionLayers.WATERLAYER;
389 DayZPhysics.RayCastBullet(m_RayStart,m_RayEnd,collisionLayerMask,null,hitObject,contact_pos,hitNormal,hitFraction);
390 m_HitPos = contact_pos;
391 }
392
393 m_Targets.Insert(new ActionTarget(null, null, -1, m_HitPos, 0));
394
395#ifdef DIAG_DEVELOPER
396 if (DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_DEBUG))
397 {
398 ShowDebugActionTargets(true);
399 DrawDebugActionTargets(true);
400 DrawDebugCone(true);
401 DrawDebugRay(true);
402 DrawSelectionPos(DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_SELPOS_DEBUG));
403 }
404 else
405 {
406 ShowDebugActionTargets(false);
407 DrawDebugActionTargets(false);
408 DrawDebugCone(false);
409 DrawDebugRay(false);
410 DrawSelectionPos(false);
411 }
412#endif
413 //Print("--------------");
414 }
415
416 private bool IsObstructed(Object object)
417 {
419 return IsObstructedEx(object, cache);
420 }
421
423 {
424 return MiscGameplayFunctions.IsObjectObstructedEx(object, cache);
425 }
426
429 { return m_Targets.Count(); }
430
433 { return m_Targets.Get(index); }
434
436 private void StoreTarget(ActionTarget pActionTarget)
437 {
438 int index = FindIndexForStoring(pActionTarget.GetUtility());
439 m_Targets.InsertAt(pActionTarget, index);
440 //Print("StoreTarget; object: " + pActionTarget.GetObject() + " | parent: " + pActionTarget.GetParent() + " | idx: " + index);
441 }
442
444 private int FindIndexForStoring(float value)
445 {
446 int left = 0;
447 int right = m_Targets.Count() - 1;
448 while ( left <= right )
449 {
450 int middle = (left + right) / 2;
451 float middleValue = m_Targets.Get(middle).GetUtility();
452
453 if ( middleValue == value )
454 return middle;
455 else if ( middleValue < value )
456 right = middle - 1;
457 else
458 left = middle + 1;
459 }
460
461 return left;
462 }
463
465 private float ComputeUtility(Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos, SurfaceInfo surfaceInfo)
466 {
469 return -1;
470
471 if (pTarget)
472 {
473 if (pTarget == cursorTarget)
474 {
476 if (pTarget.GetType() == string.Empty)
477 return 0.01;
478
479 if (pTarget.IsBuilding())
480 return 0.25;
481
482 if (pTarget.IsTransport())
483 return 0.25;
484
486 if (pTarget.CanUseConstruction())
487 return 0.85;
488
489 if (pTarget.IsWell())
490 return 0.9;
491
492 vector playerPosXZ = m_Player.GetPosition();
493 vector hitPosXZ = hitPos;
494 playerPosXZ[1] = 0;
495 hitPosXZ[1] = 0;
496 if (vector.DistanceSq(playerPosXZ, hitPosXZ) <= c_MaxTargetDistance * c_MaxTargetDistance)
497 return c_UtilityMaxValue;
498 }
499
500 if ( PlayerBase.Cast(pTarget) && PlayerBase.Cast(pTarget).IsInVehicle() ) // utility in vehicle should be below base vehicle val
501 return 0.20;
502
503 float distSqr = DistSqrPoint2Line(pTarget.GetPosition(), pRayStart, pRayEnd);
505 }
506
508 if (surfaceInfo && surfaceInfo.GetLiquidType() != LIQUID_NONE)
509 return 0.01;
510
511 return -1;
512 }
513
515 private float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
516 {
517 vector v = pL2 - pL1;
518 vector w = pPoint - pL1;
519
520 float c1 = vector.Dot(w,v);
521 float c2 = vector.Dot(v,v);
522
523 if ( c1 <= 0 || c2 == 0 )
524 return vector.DistanceSq(pPoint, pL1);
525
526 float b = c1 / c2;
527 vector nearestPoint = pL1 + (v * b);
528 return vector.DistanceSq(pPoint, nearestPoint);
529 }
530
531 private void FilterObstructedObjectsEx(Object cursor_target, array<Object> vicinityObjects)
532 {
533 #ifdef DIAG_DEVELOPER
534 if (DiagMenu.GetBool(DiagMenuIDs.MISC_ACTION_TARGETS_DEBUG))
535 CleanupDebugShapes(obstruction);
536 #endif
537
538 array<Object> obstructingObjects = new array<Object>;
539 MiscGameplayFunctions.FilterObstructingObjects(vicinityObjects, obstructingObjects);
540
541 if ( obstructingObjects.Count() > 0 )
542 {
543 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
544
545 int numObstructed = 0;
546 int mCount = m_VicinityObjects.Count();
547
548 if (mCount > GROUPING_COUNT_THRESHOLD)
549 {
550 array<Object> filteredObjects = new array<Object>;
551 MiscGameplayFunctions.FilterObstructedObjectsByGrouping(m_RayStart, c_MaxTargetDistance, c_DistanceDelta, m_VicinityObjects.GetRawVicinityObjects(), vicinityObjects, filteredObjects);
552 m_VicinityObjects.ClearVicinityObjects();
553 m_VicinityObjects.TransformToVicinityObjects(filteredObjects);
554 }
555 else
556 {
557 FilterObstructedObjects(cursor_target);
558 }
559 }
560 }
561
562 private void FilterObstructedObjects(Object cursor_target)
563 {
564 int numObstructed = 0;
565 int mCount = m_VicinityObjects.Count();
567 mCount--;
568
570 for ( int i = mCount; i >= 0; --i )
571 {
572 Object object = m_VicinityObjects.GetObject(i);
573 Object parent = m_VicinityObjects.GetParent(i);
574
576 if (object && !parent)
577 {
580 if (numObstructed > OBSTRUCTED_COUNT_THRESHOLD && object != cursor_target)
581 {
582 m_VicinityObjects.Remove(object);
583 continue;
584 }
585
587 if (object != cursor_target && IsObstructedEx(object, cache))
588 {
589 m_VicinityObjects.Remove(object);
590 numObstructed++;
591 }
592
593 cache.ClearCache();
594 }
595 }
596 }
597
598#ifdef DIAG_DEVELOPER
599 ref array<Shape> shapes = new array<Shape>();
600 ref array<Shape> dbgConeShapes = new array<Shape>();
601 ref array<Shape> rayShapes = new array<Shape>();
602 ref array<Shape> obstruction = new array<Shape>();
603 ref array<Shape> dbgPosShapes = new array<Shape>();
604
605 void ShowDebugActionTargets(bool enabled)
606 {
607 int windowPosX = 0;
608 int windowPosY = 50;
609
610 Object obj;
611
613 DbgUI.Begin("Action Targets", windowPosX, windowPosY);
614 if ( enabled )
615 {
616 for ( int i = 0; i < GetTargetsCount(); i++ )
617 {
618 obj = m_Targets.Get(i).GetObject();
619 if ( obj )
620 {
621 float util = m_Targets.Get(i).GetUtility();
622 int compIdx = m_Targets.Get(i).GetComponentIndex();
623 string compName;
624 array<string> compNames = new array<string>;
625 compName = obj.GetActionComponentName(compIdx);
626 obj.GetActionComponentNameList(compIdx, compNames);
627
628 if ( compNames.Count() > 0 )
629 {
630 for ( int c = 0; c < compNames.Count(); c++ )
631 {
632 DbgUI.Text(obj.GetDisplayName() + " :: " + obj + " | util: " + util + " | compIdx: " + compIdx + " | compName: " + compNames[c] + "| wPos: " + obj.GetWorldPosition() );
633 }
634 }
635 else
636 {
637 DbgUI.Text(obj.GetDisplayName() + " :: " + obj + " | util: " + util + " | compIdx: " + compIdx + " | compName: " + compName + "| wPos: " + obj.GetWorldPosition() );
638 }
639 }
640 else
641 continue;
642 }
643 }
644 DbgUI.End();
645 DbgUI.EndCleanupScope();
646 }
647
648 void DrawDebugActionTargets(bool enabled)
649 {
650 int s_id;
651 vector w_pos;
652 vector w_pos_sphr;
653 vector w_pos_lend;
654 Object obj;
655
656 if ( enabled )
657 {
658 CleanupDebugShapes(shapes);
659
660 for ( int i = 0; i < GetTargetsCount(); i++ )
661 {
662 obj = m_Targets.Get(i).GetObject();
663 if ( obj )
664 {
665 w_pos = obj.GetPosition();
666 // sphere pos tweaks
667 w_pos_sphr = w_pos;
668 w_pos_sphr[1] = w_pos_sphr[1] + 0.5;
669 // line pos tweaks
670 w_pos_lend = w_pos;
671 w_pos_lend[1] = w_pos_lend[1] + 0.5;
672
673 if ( i == 0 )
674 {
675 shapes.Insert( Debug.DrawSphere(w_pos_sphr, 0.03, COLOR_RED) );
676 shapes.Insert( Debug.DrawLine(w_pos, w_pos_lend, COLOR_RED) );
677 }
678 else
679 {
680 shapes.Insert( Debug.DrawSphere(w_pos_sphr, 0.03, COLOR_YELLOW) );
681 shapes.Insert( Debug.DrawLine(w_pos, w_pos_lend, COLOR_YELLOW) );
682 }
683 }
684 }
685 }
686 else
687 CleanupDebugShapes(shapes);
688 }
689
690 private void DrawDebugCone(bool enabled)
691 {
692 // "cone" settings
693 vector start, end, endL, endR;
694 float playerAngle;
695 float xL,xR,zL,zR;
696
697 if (enabled)
698 {
699 CleanupDebugShapes(dbgConeShapes);
700
701 start = m_Player.GetPosition();
702 playerAngle = MiscGameplayFunctions.GetHeadingAngle(m_Player);
703
704 // offset position of the shape in height
705 start[1] = start[1] + 0.2;
706
707 endL = start;
708 endR = start;
709 xL = c_MaxTargetDistance * Math.Cos(playerAngle + Math.PI_HALF + c_ConeAngle * Math.DEG2RAD); // x
710 zL = c_MaxTargetDistance * Math.Sin(playerAngle + Math.PI_HALF + c_ConeAngle * Math.DEG2RAD); // z
711 xR = c_MaxTargetDistance * Math.Cos(playerAngle + Math.PI_HALF - c_ConeAngle * Math.DEG2RAD); // x
712 zR = c_MaxTargetDistance * Math.Sin(playerAngle + Math.PI_HALF - c_ConeAngle * Math.DEG2RAD); // z
713 endL[0] = endL[0] + xL;
714 endL[2] = endL[2] + zL;
715 endR[0] = endR[0] + xR;
716 endR[2] = endR[2] + zR;
717
718 dbgConeShapes.Insert( Debug.DrawLine(start, endL, COLOR_BLUE) );
719 dbgConeShapes.Insert( Debug.DrawLine(start, endR, COLOR_BLUE) ) ;
720 dbgConeShapes.Insert( Debug.DrawLine(endL, endR, COLOR_BLUE) );
721 }
722 else
723 CleanupDebugShapes(dbgConeShapes);
724 }
725
726 private void DrawSelectionPos(bool enabled)
727 {
728 if (enabled)
729 {
730 CleanupDebugShapes(dbgPosShapes);
731 if (GetTargetsCount() > 0 && GetTarget(0).GetUtility() > -1 )
732 {
733 ActionTarget at = GetTarget(0);
734 if (at.GetObject())
735 {
736 string compName = at.GetObject().GetActionComponentName(at.GetComponentIndex());
737 vector modelPos = at.GetObject().GetSelectionPositionMS(compName);
738 vector worldPos = at.GetObject().ModelToWorld(modelPos);
739 dbgPosShapes.Insert( Debug.DrawSphere(worldPos, 0.25, Colors.PURPLE, ShapeFlags.NOZBUFFER) );
740 }
741 }
742 }
743 else
744 CleanupDebugShapes(dbgPosShapes);
745 }
746
747 private void DrawDebugRay(bool enabled)
748 {
749 if (enabled)
750 {
751 CleanupDebugShapes(rayShapes);
752 rayShapes.Insert( Debug.DrawSphere(m_HitPos, Math.Sqrt(c_UtilityMaxDistFromRaySqr), COLOR_BLUE_A, ShapeFlags.TRANSP) );
753 rayShapes.Insert( Debug.DrawLine(m_RayStart, m_RayEnd, COLOR_BLUE) );
754 }
755 else
756 CleanupDebugShapes(rayShapes);
757 }
758
759 private void CleanupDebugShapes(array<Shape> shapesArr)
760 {
761 for ( int it = 0; it < shapesArr.Count(); ++it )
762 {
763 Debug.RemoveShape( shapesArr[it] );
764 }
765
766 shapesArr.Clear();
767 }
768#endif
769
770 //--------------------------------------------------------
771 // Members
772 //--------------------------------------------------------
775
778
780 static private ref VicinityObjects m_VicinityObjects
781
782 private bool m_Debug
783
787
789
790 //--------------------------------------------------------
791 // Constants
792 //--------------------------------------------------------
794 private const float c_RayDistance = 5.0;
795 private const float c_MaxTargetDistance = 3.0;
797 private const float c_ConeAngle = 30.0;
798 private const float c_ConeHeightMin = -0.5;
799 private const float c_ConeHeightMax = 2.0;
800 private const float c_DistanceDelta = 0.3;
801
803 private const float c_UtilityMaxValue = 10000;
804 private const float c_UtilityMaxDistFromRaySqr = 0.8 * 0.8;
805
807 private const string CE_CENTER = "ce_center";
808 private const float HEIGHT_OFFSET = 0.2;
809
811 private const int OBSTRUCTED_COUNT_THRESHOLD = 3;
812 private const int GROUPING_COUNT_THRESHOLD = 10;
813
816};
817
eBleedingSourceType GetType()
Object m_Object
Определения ActionPushObject.c:12
int m_SurfaceLiquidType
Определения ActionTargets.c:119
int GetSurfaceLiquidType()
Определения ActionTargets.c:180
void DbgPrintTargetDump()
Определения ActionTargets.c:185
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
float m_Utility
Определения ActionTargets.c:117
string m_SurfaceName
Определения ActionTargets.c:118
vector GetCursorHitPos()
Определения ActionTargets.c:165
Object GetObject()
Определения ActionTargets.c:138
string GetSurfaceName()
Определения ActionTargets.c:175
vector m_CursorHitPos
Определения ActionTargets.c:116
float GetUtility()
Определения ActionTargets.c:160
void SetCursorHitPos(vector cursor_position)
Определения ActionTargets.c:170
map
Определения ControlsXboxNew.c:4
DayZGame g_Game
Определения DayZGame.c:3868
proto native int GetComponentIndex()
Определения ActionTargets.c:155
PhxInteractionLayers
Определения DayZPhysics.c:2
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
void CleanupDebugShapes(array< Shape > shapesArr)
DEPRECATED.
Определения DynamicMusicPlayer.c:1033
DiagMenuIDs
Определения EDiagMenuIDs.c:2
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:1944
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int windowPosY
Определения PluginPresenceNotifier.c:77
Widget m_Parent
Определения SizeToChild.c:92
SurfaceDetectionType
Определения SurfaceInfo.c:66
UseObjectsMode
Определения SurfaceInfo.c:54
void Debug()
Определения UniversalTemperatureSource.c:349
override bool CanBeActionTarget()
Определения WoodBase.c:256
SurfaceInfo m_SurfaceInfo
Определения ActionTargets.c:788
const float c_UtilityMaxDistFromRaySqr
Определения ActionTargets.c:804
const float c_MaxTargetDistance
Определения ActionTargets.c:795
vector m_RayEnd
Определения ActionTargets.c:785
const float c_DistanceDelta
Определения ActionTargets.c:800
int GetTargetsCount()
returns count of founded targets
Определения ActionTargets.c:428
const string CE_CENTER
p3d
Определения ActionTargets.c:807
const float HEIGHT_OFFSET
Определения ActionTargets.c:808
float ComputeUtility(Object pTarget, vector pRayStart, vector pRayEnd, Object cursorTarget, vector hitPos, SurfaceInfo surfaceInfo)
computes utility of target
Определения ActionTargets.c:465
static array< Object > GetVicinityObjects()
Определения ActionTargets.c:214
const float c_ConeAngle
Определения ActionTargets.c:797
const int OBSTRUCTED_COUNT_THRESHOLD
misc
Определения ActionTargets.c:811
void Update()
Определения ActionTargets.c:224
void FilterObstructedObjects(Object cursor_target)
Определения ActionTargets.c:562
const float c_MaxActionDistance
Определения ActionTargets.c:796
bool IsObstructedEx(Object object, IsObjectObstructedCache cache)
Определения ActionTargets.c:422
bool IsObstructed(Object object)
Определения ActionTargets.c:416
float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
distance between point and line
Определения ActionTargets.c:515
vector m_HitPos
Определения ActionTargets.c:786
void StoreTarget(ActionTarget pActionTarget)
inserts action into sorted array based on utility
Определения ActionTargets.c:436
const float c_RayDistance
searching properties
Определения ActionTargets.c:794
PlayerBase m_Player
player owner
Определения ActionTargets.c:774
ActionTarget GetTarget(int index)
returns action target at index
Определения ActionTargets.c:432
void FilterObstructedObjectsEx(Object cursor_target, array< Object > vicinityObjects)
Определения ActionTargets.c:531
void ActionTargets(PlayerBase player)
Определения ActionTargets.c:205
void Clear()
Определения ActionTargets.c:219
const int GROUPING_COUNT_THRESHOLD
Определения ActionTargets.c:812
vector CalculateRayStart()
DEPRECATED.
vector m_RayStart
objects in vicinity
Определения ActionTargets.c:784
ref array< ref ActionTarget > m_Targets
selected & sorted targets by utility function
Определения ActionTargets.c:777
const float c_UtilityMaxValue
utility constants
Определения ActionTargets.c:803
int FindIndexForStoring(float value)
binary search algorithm
Определения ActionTargets.c:444
const float c_ConeHeightMax
Определения ActionTargets.c:799
const float c_ConeHeightMin
Определения ActionTargets.c:798
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
Super root of all classes in Enforce script.
Определения EnScript.c:11
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)
Определения DayZPhysics.c:124
Определения DbgUI.c:60
Определения EnDebug.c:241
override bool IsTakeable()
Определения BaseBuildingBase.c:1008
ref array< Object > Objects
Определения ActionTargets.c:820
Определения ActionTargets.c:819
Определения 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
SurfaceInfo surface
surface material info handle
Определения DayZPhysics.c:109
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
Определения DayZPhysics.c:99
bool includeWater
Include water in the surface detection, will return the water if it is higher than the surface.
Определения SurfaceInfo.c:83
SurfaceDetectionType type
Type of surface to detect.
Определения SurfaceInfo.c:77
RoadSurfaceDetection rsd
See RoadSurfaceDetection, SurfaceTraceType.Roadway only.
Определения SurfaceInfo.c:92
vector position
3D position to trace the surface from
Определения SurfaceInfo.c:80
UseObjectsMode syncMode
See UseObjectsMode, SurfaceTraceType.Roadway only.
Определения SurfaceInfo.c:86
SurfaceInfo surface
Returned SurfaceInfo, plain pointer.
Определения SurfaceInfo.c:114
proto int GetLiquidType()
See 'LiquidTypes' in 'constants.c'.
static proto SurfaceInfo GetByFile(string name)
proto string GetSurfaceType()
Определения SurfaceInfo.c:9
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
static const vector Zero
Определения EnConvert.c:110
Определения 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
Определения 1_Core/constants.c:66
const int COLOR_BLUE_A
Определения 1_Core/constants.c:71
const int COLOR_RED
Определения 1_Core/constants.c:64
const int COLOR_YELLOW
Определения 1_Core/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.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int LIQUID_NONE
Определения 3_Game/constants.c:529
proto native Widget GetParent()
Get parent of the Effect.
Определения Effect.c:422