DayZ 1.24
Loading...
Searching...
No Matches
Hologram.c
Go to the documentation of this file.
2{
3#ifdef SERVER
4 protected const int SPAWN_FLAGS = ECE_CREATEPHYSICS;
5#else
6 protected const int SPAWN_FLAGS = ECE_LOCAL;
7#endif
8
9
10#ifdef DIAG_DEVELOPER
11 string m_CollisionDetails;
12#endif
13
14 protected const string SUFFIX_MATERIAL_DEPLOYABLE = "_deployable.rvmat";
15 protected const string SUFFIX_MATERIAL_UNDEPLOYABLE = "_undeployable.rvmat";
16 protected const string SUFFIX_MATERIAL_POWERED = "_powered.rvmat";
17
18 protected ItemBase m_Parent;
22 protected string m_ProjectionTypename;
23
24 protected bool m_IsColliding;
25 protected bool m_IsCollidingGPlot;
26 protected bool m_IsSlope;
27 protected bool m_IsCollidingPlayer;
28 protected bool m_IsFloating;
29 protected bool m_UpdatePosition;
30 protected bool m_IsHidden;
31
33 protected vector m_Rotation;
37 protected const string ANIMATION_PLACING = "Placing";
38 protected const string ANIMATION_INVENTORY = "Inventory";
39 protected const string SELECTION_PLACING = "placing";
40 protected const string SELECTION_INVENTORY = "inventory";
41
42 protected const float SMALL_PROJECTION_RADIUS = 1;
43 protected const float SMALL_PROJECTION_GROUND = 2;
44 protected const float DISTANCE_SMALL_PROJECTION = 1;
45 protected const float LARGE_PROJECTION_DISTANCE_LIMIT = 6;
46 protected const float PROJECTION_TRANSITION_MIN = 1;
47 protected const float PROJECTION_TRANSITION_MAX = 0.25;
48 protected const float LOOKING_TO_SKY = 0.75;
49 static const float DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF = 1.5;
50
51 protected float m_SlopeTolerance;
52 protected bool m_AlignToTerrain;
54 protected int m_ContactComponent;
55
57
58 // Watchtower correction variables
59 // These watchtower component names should be corrected when colliding with them as they are supposed to be "trigger boxes", not colliders
61
62 // These watchtower components are supposed to be trigger boxes, but should block placement on them (currently only the boxes above the stairs)
64
66 {
68 m_Parent = item;
70
72 m_UpdatePosition = true;
74
75 m_Rotation = "0 0 0";
76 m_FromAdjusted = "0 0 0";
77
78 // If the static names are empty, generate the needed names
79 // Refer to their definitions to see why these are required
80 if (m_WatchtowerIgnoreComponentNames.Count() == 0)
81 {
82 string baseStringBegin = Watchtower.BASE_VIEW_NAME;
83 string baseIgnoreStringEnd = Watchtower.BASE_WALL_NAME;
84
85 int floors = Watchtower.MAX_WATCHTOWER_FLOORS;
86 int walls = Watchtower.MAX_WATCHTOWER_WALLS;
87
88 string compName;
89 for (int i = 1; i < floors + 1; ++i)
90 {
91 compName = baseStringBegin + i.ToString();
92 for (int j = 1; j < walls + 1; ++j)
94
95 if (i != 1)
97 else
99 }
100 }
101
102 string configPathProjectionTypename = string.Format("CfgVehicles %1 projectionTypename", m_Parent.GetType());
103 if (GetGame().ConfigIsExisting(configPathProjectionTypename))
105
107 if (GetGame().IsMultiplayer() && GetGame().IsServer())
108 {
110 projectionEntity.SetAllowDamage(false);
113 }
114 else
115 {
117 if (projectionEntity == null)
118 {
119 ErrorEx(string.Format("Cannot create hologram entity from config class %1", ProjectionBasedOnParent()), ErrorExSeverity.WARNING);
120 return;
121 }
122
127 }
128
129 if (ItemBase.Cast(projectionEntity))
130 ItemBase.Cast(GetProjectionEntity()).SetIsHologram(true);
131
132 string configPathSlope = string.Format("CfgVehicles %1 slopeTolerance", GetProjectionEntity().GetType());
133 if (GetGame().ConfigIsExisting(configPathSlope))
134 m_SlopeTolerance = GetGame().ConfigGetFloat(configPathSlope);
135
136 string configPathAlign = string.Format("CfgVehicles %1 alignHologramToTerain", GetProjectionEntity().GetType());
137 if (GetGame().ConfigIsExisting(configPathAlign))
138 m_AlignToTerrain = GetGame().ConfigGetInt(configPathAlign);
139
140 string configPathOrientationLimit = string.Format("CfgVehicles %1 yawPitchRollLimit", GetProjectionEntity().GetType());
141 if (GetGame().ConfigIsExisting(configPathOrientationLimit))
143 }
144
146 {
147 if (GetGame())
148 {
149 if (m_Projection)
150 GetGame().ObjectDelete(m_Projection);
151
153 GetGame().ObjectDelete(m_ProjectionTrigger);
154 }
155
156#ifdef DIAG_DEVELOPER
158#endif
159 }
160
162 {
163 if (m_Projection.HasAnimation(ANIMATION_PLACING))
164 {
165 m_Projection.SetAnimationPhase(ANIMATION_PLACING, 0);
167
168 if (m_Projection.HasAnimation(ANIMATION_INVENTORY))
169 m_Projection.SetAnimationPhase(ANIMATION_INVENTORY, 1);
170 }
171 else
172 {
175 }
176 }
177
178 // Updates selections on hologram object so they reflect the state of the parent object's selections.
180 {
181 string cfg_access = "CfgVehicles " + m_Projection.GetType() + " AnimationSources ";
182
183 if (GetGame().ConfigIsExisting(cfg_access))
184 {
185 int cfg_access_count = g_Game.ConfigGetChildrenCount(cfg_access);
186
187 for (int i = 0; i < cfg_access_count; ++i)
188 {
189 string found_anim;
190 GetGame().ConfigGetChildName(cfg_access, i, found_anim);
191
192 float anim_phase = m_Parent.GetAnimationPhase(found_anim);
193 m_Projection.SetAnimationPhase(found_anim, anim_phase);
194 }
195 }
196 }
197
199 {
201 }
202
204 {
206 if (m_ProjectionTypename != "")
208
209 if (!item)
210 return "";
211
212 if (item.CanMakeGardenplot())
213 return "GardenPlotPlacing";
214
215 //Camping & Base building
216 if (item.IsInherited(TentBase) || item.IsBasebuildingKit())
217 return item.GetType() + "Placing";
218
219 return item.GetType();
220 }
221
224 {
225 return item && (item.IsDeployable() || item.CanMakeGardenplot() || item.IsInherited(DeployableContainer_Base));
226 }
227
228 // update loop for visuals and collisions of the hologram
230 {
231 if (!m_Parent)
232 {
233 m_Player.TogglePlacingLocal();
234
235 return;
236 }
237
239 {
240 m_Player.TogglePlacingLocal();
241
242 return;
243 }
244
245 if (!GetUpdatePosition())
246 return;
247
248
249#ifdef DIAG_DEVELOPER
252#endif
253
254 // update hologram position
257
262
263 m_Projection.OnHologramBeingPlaced(m_Player);
264 }
265
267 {
269
271 {
273 vector mat0[3];
274 vector mat1[3];
275 vector mat2[3];
278
279 if (m_ContactDir.Length() > 0)
281 else
282 normal = GetGame().SurfaceGetNormal(projection_position[0], projection_position[2]);
283
284 vector angles = normal.VectorToAngles();
285 angles[1] = angles[1] + 270;
286
287 angles[0] = Math.Clamp(angles[0], 0, 360);
288 angles[1] = Math.Clamp(angles[1], 0, 360);
289 angles[2] = Math.Clamp(angles[2], 0, 360);
290
292
296
298 }
299 else
300 {
302
303 if (y_p_r[0] > 180)
304 y_p_r[0] = y_p_r[0] - 360;
305
306 if (y_p_r[0] < -180)
307 y_p_r[0] = y_p_r[0] + 360;
308 }
309
311 }
312
314 {
316 {
317 if (Math.AbsFloat(y_p_r[0] - m_y_p_r_previous[0]) > 100)
318 {
319 if (y_p_r[0] > 0)
321
322 if (y_p_r[0] < 0)
324 }
325
326 y_p_r[0] = Math.Lerp(m_y_p_r_previous[0], y_p_r[0], 15 * timeslice);
327 y_p_r[1] = Math.Lerp(m_y_p_r_previous[1], y_p_r[1], 15 * timeslice);
328 y_p_r[2] = Math.Lerp(m_y_p_r_previous[2], y_p_r[2], 15 * timeslice);
329 }
330
332
333 return y_p_r;
334 }
335
337 {
338 Class.CastTo(m_ProjectionTrigger, g_Game.CreateObjectEx("ProjectionTrigger", GetProjectionPosition(), SPAWN_FLAGS));
339
341 m_ProjectionTrigger.SetParentObject(this);
342 m_ProjectionTrigger.SetParentOwner(m_Player);
343
345 }
346
356
357#ifdef DIAG_DEVELOPER
358 void DebugText(string header, bool mustBeTrue = false, bool condition = true, string info = "")
359 {
360 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
361 {
362 int color = 0xFFFFFFFF;
363
366
367 string text = header + condition + info;
369 }
370 }
371
372 protected float m_PitchOverride;
373 protected float m_RollOverride;
374 void DebugConfigValues()
375 {
376 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
377 {
380
381 DbgUI.InputFloat("slopeTolerance override", m_SlopeTolerance);
382 DbgUI.SameLine();
383 DbgUI.InputFloat("pitch limit override", m_PitchOverride);
384 DbgUI.SameLine();
385 DbgUI.InputFloat("roll limit override", m_RollOverride);
386
389 }
390 }
391#endif
392
394 {
395#ifdef DIAG_DEVELOPER
397#endif
398
399 if (!m_Player.CanPlaceItem(m_Projection))
400 {
401#ifdef DIAG_DEVELOPER
402 m_CollisionDetails += "[Player]";
403#endif
404 SetIsColliding(true);
405
406 }
408 SetIsColliding(true);
409 else if (m_Projection.IsInherited(TrapSpawnBase))
410 {
411#ifdef DIAG_DEVELOPER
412 DebugText("Inherits from TrapSpawnBase, checking IsPlaceableAtposition", true);
413#endif
414
417 SetIsColliding(!trapSpawnBase.IsPlaceableAtPosition(m_Projection.GetPosition()));
418 }
419 else if (m_Projection.IsInherited(TrapBase))
420 {
421#ifdef DIAG_DEVELOPER
422 DebugText("Inherits from TrapBase, checking IsPlaceableAtposition", true);
423#endif
426 SetIsColliding(!trapBase.IsPlaceableAtPosition(m_Projection.GetPosition()));
427 }
428 else
429 SetIsColliding(false);
430 }
431
433 {
435 return false;
436 if (GetGame().IsServer() && GetGame().IsMultiplayer())
437 return false;
438
439 //Some locations allow you to look up and attempt placing the hologram on the bottom side of a floor - most notably the floors of a watchtower
440 //This check also prevents some very unnatural placements
441
442 bool b1 = m_Projection.GetPosition()[1] > GetGame().GetCurrentCameraPosition()[1];
443 bool b2 = false;
444#ifdef DIAG_DEVELOPER
445 vector from, to;
446#endif
447 if (m_Projection.DoPlacingHeightCheck())
448 {
450#ifdef DIAG_DEVELOPER
451 MiscGameplayFunctions.IsUnderRoofFromToCalculation(m_Projection, from, to);
452 DrawArrow(from, to, !b2);
453#endif
454 }
455
456#ifdef DIAG_DEVELOPER
457 DebugText("IsClippingRoof: ", false, b1, " | (projection height) " + m_Projection.GetPosition()[1] + " > (camera height) " + GetGame().GetCurrentCameraPosition()[1]);
458 DebugText("IsClippingRoof: ", false, b2, " | (DoPlacingHeightCheck) " + m_Projection.DoPlacingHeightCheck() + " && (IsUnderRoof) " + MiscGameplayFunctions.IsUnderRoof(m_Projection) + " | from: " + from[1] + " | to: " + to[1]);
459#endif
460
461 return b1 || b2;
462 }
463
465 {
467 return false;
468 vector projection_orientation = m_Projection.GetOrientation();
470#ifdef DIAG_DEVELOPER
471 DebugText("IsCollidingAngle: ", false, isTrue, " | (proj pitch) " + Math.AbsFloat(projection_orientation[1]) + " > (pitch limit) " + m_YawPitchRollLimit[1] + " | (proj roll) " + Math.AbsFloat(projection_orientation[2]) + " > (roll limit) " + m_YawPitchRollLimit[2]);
472#endif
473
474 return isTrue;
475 }
476
477#ifdef DIAG_DEVELOPER
478 protected Shape m_CollisionBox;
479 protected void DrawDebugCollisionBox(vector min_max[2], int color)
480 {
481 vector mat[4];
482 m_Projection.GetTransform(mat);
484 m_CollisionBox.SetMatrix(mat);
485 }
486
487 protected void DestroyDebugCollisionBox()
488 {
489 if (m_CollisionBox)
490 {
491 m_CollisionBox.Destroy();
493 }
494 }
495#endif
496
498 {
500 return false;
501
503 vector relativeOffset; //we need to lift BBox, because it is calculated from the bottom of projection, and not from the middle
504 vector absoluteOffset = "0 0.05 0"; //we need to lift BBox even more, because it colliddes with house floors due to various reasons (probably geometry or float imperfections)
507 vector minMax[2];
510
512 relativeOffset[1] = (minMax[1][1] - minMax[0][1]) * 0.5;
517
518 if (action_item)
520
521 //add is construction check
522 // Base building objects behave in a way that causes this test to generate false positives
524#ifdef DIAG_DEVELOPER
525 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
526 {
527 string text = "";
528 foreach (Object object: collidedObjects)
529 text += " | " + Object.GetDebugName(object);
530
531 DebugText("IsCollidingBBox: ", false, isTrue, text);
532
533 int color = 0x01FFFFFF;
534 if (isTrue)
535 color = 0x33F22613;
536
538 }
539#endif
540
541 return isTrue;
542 }
543
545 {
546 //This function is not required to solve server-side fixes for clipping, saves calculations and potential false negatives
547 if (GetGame().IsServer() && GetGame().IsMultiplayer())
548 return true;
549
551 return true;
552
555
558
561
564
585
586 //Not sure what the intention here was before, but it boiled down to a very bloated version of what you see here right now
588 if (results_left_close.Count() > 0)
590
592 if (results_right_close.Count() > 0)
594
596 if (results_left_far.Count() > 0)
598
600 if (results_right_far.Count() > 0)
602
604 }
605
607 {
609 return false;
610
611#ifdef DIAG_DEVELOPER
612 DebugText("IsCollidingGPlot: ", false, m_IsCollidingGPlot);
613#endif
614
615 return m_IsCollidingGPlot;
616 }
617
619 {
620 vector origin = Vector(0, 0, 0);
622#ifdef DIAG_DEVELOPER
623 DebugText("IsCollidingZeroPos: ", false, isTrue);
624#endif
625
626 return isTrue;
627 }
628
631 {
632 ErrorEx("Deprecated check - do not use", ErrorExSeverity.WARNING);
633 return false;
634 }
635
636 //This function only takes one of the found objects since IsBaseIntact already verifies that all of them are either null or the same object
638 {
639 //check if the object below hologram is dynamic object. Dynamic objects like barrels can be taken to hands
640 //and item which had been placed on top of them, would stay floating in the air
641#ifdef DIAG_DEVELOPER
642 if (objectToCheck == null)
643 DebugText("IsBaseStatic(must be true): ", true, true, " | objectToCheck is null (this is good)");
644 else
645 DebugText("IsBaseStatic(must be true): ", true, IsObjectStatic(objectToCheck));
646#endif
648 }
649
651 {
652 return obj.IsBuilding() || obj.IsPlainObject() || (!m_Parent.IsInherited(KitBase) && obj.IsInherited(BaseBuildingBase) && (m_WatchtowerBlockedComponentNames.Find(obj.GetActionComponentName(m_ContactComponent, LOD.NAME_VIEW)) == -1));
653 }
654
656 {
658#ifdef DIAG_DEVELOPER
659 DebugText("IsBaseIntact(must be true and all equal): ", true, isTrue, " | ulc: " + Object.GetDebugName(under_left_close) + " | urc: " + Object.GetDebugName(under_right_close) + " | ulf: " + Object.GetDebugName(under_left_far) + " | urf: " + Object.GetDebugName(under_right_far));
660 if (!isTrue)
661 {
665 conditions.Insert(under_left_far == null);
667
668 int amountOfNull = 0;
669 if (!under_left_close)
670 ++amountOfNull;
672 ++amountOfNull;
673 if (!under_left_far)
674 ++amountOfNull;
675 if (!under_right_far)
676 ++amountOfNull;
677
678 if (amountOfNull < 3)
679 for (int i = 0; i < conditions.Count(); ++i)
681
683 }
684#endif
685
686 return isTrue;
687 }
688
689#ifdef DIAG_DEVELOPER
690 void DrawArrow(vector from, vector to, bool condition)
691 {
692 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
693 {
694 int color = 0xFFFFFFFF;
695 if (!condition)
697
699 }
700 }
701
702 void DrawSphere(vector pos, bool condition)
703 {
704 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
705 {
706 int color = 0x01FFFFFF;
707 if (!condition)
708 color = 0x99F22613;
709
710 Debug.DrawSphere(pos, 1, color, ShapeFlags.ONCE | ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE);
711 }
712 }
713
715 {
716 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
717 {
719 positions.Insert(m_Projection.CoordToParent(GetLeftCloseProjectionVector()));
721 positions.Insert(m_Projection.CoordToParent(GetLeftFarProjectionVector()));
722 positions.Insert(m_Projection.CoordToParent(GetRightFarProjectionVector()));
723
724 for (int i = 0; i < positions.Count(); ++i)
725 DrawSphere(positions[i], conditions[i]);
726 }
727 }
728
729 void DrawDebugArrow(float start, float dist, int color = 0xFF1FFFFF)
730 {
731 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
732 {
733 vector from = m_Player.GetPosition() + start * MiscGameplayFunctions.GetHeadingVector(m_Player);
734 vector to = m_Player.GetPosition() + dist * MiscGameplayFunctions.GetHeadingVector(m_Player);
735
736 Debug.DrawArrow(from, to, 0.5, 0xFF1FFFFF, ShapeFlags.ONCE | ShapeFlags.TRANSP);
737 }
738 }
739#endif
740
760
763 {
765 return true;
766
768
769#ifdef DIAG_DEVELOPER
770 DebugText("IsPlacementPermitted(must be true): ", true, isTrue, " (Note: ItemBase::CanBePlaced() return value)");
771#endif
772 return isTrue;
773 }
774
777 {
779 return true;
780 if (GetProjectionEntity()) //simple height check
781 {
782 vector playerpos = m_Player.GetPosition();
784 float delta1 = playerpos[1] - projectionpos[1];
785
787 {
788#ifdef DIAG_DEVELOPER
789 DebugText("HeightPlacementCheck(must be true): ", true, false, " | Height difference between item and player is larger than " + DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF);
790#endif
791 return false;
792 }
793 }
794#ifdef DIAG_DEVELOPER
795 DebugText("HeightPlacementCheck(must be true): ", true, true);
796#endif
797 return true;
798 }
799
801 {
803 return false;
804 // Fast check middle of object
805 string type;
806 int liquid;
807 g_Game.SurfaceUnderObject(m_Projection, type, liquid);
808
809 if (liquid == LIQUID_WATER)
810 {
811#ifdef DIAG_DEVELOPER
812 DebugText("IsUnderwater: ", false, true, " | Surface under object is water");
813#endif
814 return true;
815 }
816
817 // Check every corner of the object
823
824#ifdef DIAG_DEVELOPER
825 // I'd rather duplicate this on internal than introduce (even) more raycasts than needed on retail..
826 float lc = g_Game.GetWaterDepth(left_close);
827 float rc = g_Game.GetWaterDepth(right_close);
828 float lf = g_Game.GetWaterDepth(left_far);
829 float rf = g_Game.GetWaterDepth(right_far);
830 bool isTrue = (lc > 0 || rc > 0 || lf > 0 || rf > 0 || surface_sea_water);
831 DebugText("IsUnderwater: ", false, isTrue, " surface_sea_water: " + surface_sea_water + " | (all must be less than zero) | lc: " + lc + " | rc: " + rc + " | lf: " + lf + " | rf: " + rf);
832 //DebugText("Corner Height: ", false, true, " lc: " + left_close[1] + " | rc: " + right_close[1] + " | lf: " + left_far[1] + " | rf: " + right_far[1]);
833 if (isTrue)
834 {
835 array<bool> conditions = {lc <= 0, rc <= 0, lf <= 0, rf <= 0};
837 }
838#endif
839
840 return (surface_sea_water || g_Game.GetWaterDepth(left_close) > 0 || g_Game.GetWaterDepth(right_close) > 0 || g_Game.GetWaterDepth(left_far) > 0 || g_Game.GetWaterDepth(right_far) > 0);
841 }
842
844 {
846 return false;
847 vector fromHeightOffset = "0 0.3 0";
848 vector toHeightOffset = "0 1 0";
849
852
855
858
861
866
871
876
877#ifdef DIAG_DEVELOPER
878 // I'd rather duplicate this on internal than introduce (even) more raycasts than needed on retail..
887 bool isTrue = (lc || rc || lf || rf);
888 string text = "";
889 if (isTrue)
890 {
891 if (lc)
892 text += " | lc";
893 if (rc)
894 text += " | rc";
895 if (lf)
896 text += " | lf";
897 if (rf)
898 text += " | rf";
899
900 if (lcO.Count() > 0)
901 text += " | lcO: " + lcO[0];
902 if (rcO.Count() > 0)
903 text += " | rcO: " + rcO[0];
904 if (lfO.Count() > 0)
905 text += " | lfO: " + lfO[0];
906 if (rfO.Count() > 0)
907 text += " | rfO: " + rfO[0];
908
909 array<bool> conditions = {!lc, !rc, !lf, !rf};
911 }
912 DebugText("IsInTerrain: ", false, isTrue, text);
913#endif
914
916 return true;
917
919 return true;
920
922 return true;
923
925 return true;
926
927 return false;
928 }
929
931 {
932 //in range of its power source.
933 if (m_Player && m_Parent && m_Parent.HasEnergyManager() && m_Parent.GetCompEM().IsPlugged())
934 {
935 // Unplug the device when the player is too far from the power source.
936 m_Parent.GetCompEM().UpdatePlugState();
937
938 // Delete local hologram when plug is rippled out and advanced placement is active
939 if (GetGame().IsMultiplayer() && GetGame().IsClient())
940 {
941 if (!m_Parent.GetCompEM().IsPlugged())
942 m_Player.TogglePlacingLocal();
943 }
944 }
945 }
946
948 {
949 //string-based comparison
950 if (entity_for_placing.IsInherited(TentBase) || entity_for_placing.IsBasebuildingKit())
951 return entity_for_placing;
952
953 if (m_Projection.IsInherited(GardenPlotPlacing))
954 {
955 Class.CastTo(entity_for_placing, GetGame().CreateObjectEx("GardenPlot", m_Projection.GetPosition(), ECE_OBJECT_SWAP));
956 return entity_for_placing;
957 }
958
959 //inheritance comparison
960 if (!GetProjectionEntity().IsKindOf(m_Parent.GetType()))
961 Class.CastTo(entity_for_placing, GetGame().CreateObjectEx(m_Projection.GetType(), m_Projection.GetPosition(), ECE_OBJECT_SWAP));
962
963 return entity_for_placing;
964 }
965
967 {
968 if (!m_Projection.GetCollisionBox(min_max) && m_Projection.MemoryPointExists("box_placing_min"))
969 {
970 min_max[0] = m_Projection.GetMemoryPointPos("box_placing_min");
971 min_max[1] = m_Projection.GetMemoryPointPos("box_placing_max");
972 //Debug.DrawSphere(m_Projection.ModelToWorld(min_max[0]) , 0.8,Colors.RED, ShapeFlags.ONCE);
973 //Debug.DrawSphere(m_Projection.ModelToWorld(min_max[1]), 0.8,Colors.RED, ShapeFlags.ONCE);
974 }
975 }
976
978 {
979 vector box_size = Vector(1, 1, 1);
980
981 box_size[0] = min_max[1][0] - min_max[0][0];
982 box_size[2] = min_max[1][2] - min_max[0][2];
983 box_size[1] = min_max[1][1] - min_max[0][1];
984
985 return box_size;
986 }
987
995
997 {
998 vector min_max[2];
1000 min_max[1][1] = min_max[0][1];
1001 min_max[1][2] = min_max[0][2];
1002
1003 return min_max[1];
1004 }
1005
1007 {
1008 vector min_max[2];
1010 min_max[0][2] = min_max[1][2];
1011
1012 return min_max[0];
1013 }
1014
1016 {
1017 vector min_max[2];
1019 min_max[1][1] = min_max[0][1];
1020
1021 return min_max[1];
1022 }
1023
1024 // Replaced by IsUnderwater, currently unused
1026 {
1027 CGame game = GetGame();
1028 return game.SurfaceIsSea(position[0], position[2]) || game.SurfaceIsPond(position[0], position[2]);
1029 }
1030
1032 {
1033 CGame game = GetGame();
1034 return game.SurfaceIsSea(position[0], position[2]);
1035 }
1036
1038 {
1042 vector minMax[2];
1044 float cameraToPlayerDistance = vector.Distance(GetGame().GetCurrentCameraPosition(), player.GetPosition());
1045
1046 if (projectionRadius < SMALL_PROJECTION_RADIUS) // objects with radius smaller than 1m
1047 {
1050 }
1051 else
1052 {
1056 }
1057
1058 vector from = GetGame().GetCurrentCameraPosition();
1059 //adjusts raycast origin to player head approx. level (limits results behind the character)
1060 if (DayZPlayerCamera3rdPerson.Cast(player.GetCurrentCamera()))
1061 {
1063 MiscGameplayFunctions.GetHeadBonePos(player, head_pos);
1064 float dist = vector.Distance(head_pos, from);
1065 from = from + GetGame().GetCurrentCameraDirection() * dist;
1066 }
1067
1068 vector to = from + (GetGame().GetCurrentCameraDirection() * (maxProjectionDistance + cameraToPlayerDistance));
1071
1073
1074 bool contactHitProcessed = false;
1077 {
1078 if (hitObjects.Count() > 0)
1079 {
1080 if (hitObjects[0].IsInherited(Watchtower))
1081 {
1082 contactHitProcessed = true;
1084 }
1085
1086 if (!contactHitProcessed && hitObjects[0].IsInherited(InventoryItem))
1087 contactPosition = hitObjects[0].GetPosition();
1088 }
1089 }
1090
1091 static const float raycastOriginOffsetOnFail = 0.25;
1092 static const float minDistFromStart = 0.01;
1093 // Camera isn't correctly positioned in some cases, leading to raycasts hitting the object directly behind the camera
1095 {
1096 from = contactPosition + GetGame().GetCurrentCameraDirection() * raycastOriginOffsetOnFail;
1098 }
1099
1102
1103#ifdef DIAG_DEVELOPER
1105 if (DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM))
1106 Debug.DrawSphere(GetProjectionPosition(), 0.1, 0x99FF0000, ShapeFlags.ONCE | ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE);
1107#endif
1108
1110
1111 return contactPosition;
1112 }
1113
1123 {
1126
1127#ifdef DIAG_DEVELOPER
1128 DebugText("SetHologramPosition::startPosition: ", false, m_IsHidden, string.Format(" | %1", startPosition));
1129 DebugText("SetHologramPosition::contactPosition [in]: ", false, m_IsHidden, string.Format(" | %1", contactPosition));
1130 DebugText("SetHologramPosition::minProjectionDistance: ", false, m_IsHidden, string.Format(" | %1", minProjectionDistance));
1131 DebugText("SetHologramPosition::maxProjectionDistance: ", false, m_IsHidden, string.Format(" | %1", maxProjectionDistance));
1132 DebugText("SetHologramPosition::playerToProjectionDistance: ", false, m_IsHidden, string.Format(" | %1", playerToProjectionDistance));
1133#endif
1134
1135 //hologram is at min distance from player
1137 {
1139 playerToProjection.Normalize();
1140 //prevents the hologram to go underground/floor while hologram exceeds minProjectionDistance
1142
1144
1145#ifdef DIAG_DEVELOPER
1146 DebugText("SetHologramPosition::contactPosition[out] (< minProjectDistance): ", false, m_IsHidden, string.Format(" | %1", contactPosition));
1147#endif
1148
1149 return true;
1150 }
1151 //hologram is at max distance from player
1153 {
1155 playerToProjection.Normalize();
1156 //prevents the hologram to go underground/floor while hologram exceeds maxProjectionDistance
1158
1160
1161#ifdef DIAG_DEVELOPER
1162 DebugText("SetHologramPosition::contactPosition[out] (< maxProjectionDistance): ", false, m_IsHidden, string.Format(" | %1", contactPosition));
1163#endif
1164
1165 return true;
1166 }
1167
1168 return false;
1169 }
1170
1172 {
1173 return m_Parent.IsBasebuildingKit() || m_Parent.IsInherited(TentBase);
1174 }
1175
1177 {
1178 // Raycast has hit one of the trigger boxes that show construction prompts, so projection would be floating in the air without this correction
1179 if (m_WatchtowerIgnoreComponentNames.Find(hitObject.GetActionComponentName(contactComponent, LOD.NAME_VIEW)) != -1)
1180 contactPos[1] = hitObject.GetActionComponentPosition(contactComponent, LOD.NAME_VIEW)[1];
1181
1182 return contactPos;
1183 }
1184
1185 //This function is currently unused
1187 {
1188 return m_Projection.IsInherited(TrapBase) || m_Projection.IsInherited(TrapSpawnBase);
1189 }
1190
1192 {
1193 float diameter;
1194 float radius;
1196 vector min_max[2];
1197
1200 diameter = diagonal.Length();
1201
1202 return diameter;
1203 }
1204
1206 {
1207 float diameter;
1208 float radius;
1210 vector min_max[2];
1211
1214 diameter = diagonal.Length();
1215 radius = diameter / 2;
1216
1217 return radius;
1218 }
1219
1221 {
1223 }
1224
1226 {
1227 return m_UpdatePosition;
1228 }
1229
1231 {
1232 return m_Parent;
1233 }
1234
1239
1241 {
1242 return m_Projection;
1243 }
1244
1246 {
1248 }
1249
1251 {
1252#ifdef DIAG_DEVELOPER
1253 DebugText("Is colliding: ", false, is_colliding, m_CollisionDetails);
1254#endif
1256 }
1257
1259 {
1261 }
1262
1267
1272
1274 {
1275#ifdef DIAG_DEVELOPER
1276 DebugText("IsFloating: ", false, m_IsFloating);
1277#endif
1278 return m_IsFloating;
1279 }
1280
1282 {
1283 return m_IsColliding;
1284 }
1285
1287 {
1288#ifdef DIAG_DEVELOPER
1289 DebugText("IsHidden: ", false, m_IsHidden);
1290#endif
1291 return m_IsHidden;
1292 }
1293
1295 {
1297 return false;
1298#ifdef DIAG_DEVELOPER
1299 DebugText("IsCollidingPlayer: ", false, m_IsCollidingPlayer);
1300#endif
1301 return m_IsCollidingPlayer;
1302 }
1303
1305 {
1306 m_Projection.SetPosition(position);
1307
1308 if (IsFloating())
1309 m_Projection.SetPosition(SetOnGround(position));
1310 }
1311
1313 {
1314 m_Projection.SetOrientation(orientation);
1315 }
1316
1318 {
1319 return m_Rotation;
1320 }
1321
1323 {
1324 m_Rotation[0] = m_Rotation[0] + addition;
1325 }
1326
1331
1333 {
1335 vector ground;
1338
1340
1341 vector to = from + ground;
1343
1345 rayInput.flags = CollisionFlags.ALLOBJECTS;
1347
1349 {
1351 for (int i = 0; i < results.Count(); i++)
1352 {
1353 res = results.Get(i);
1354 if (res.entry || (!res.obj && !res.parent))
1355 {
1356 contact_pos = res.pos;
1357 break;
1358 }
1359 }
1360 }
1361
1362 //LOS check
1363 if (contact_pos != "0 0 0")
1364 {
1367 int check_component = -1;
1369 to = contact_pos;
1370 to[1] = to[1] + 0.1;
1372
1374 {
1375 if ((hit_object.Count() > 0) && (!hit_object[0].IsInherited(Watchtower) || (hit_object[0].IsInherited(Watchtower) && (m_WatchtowerIgnoreComponentNames.Find(hit_object[0].GetActionComponentName(check_component, LOD.NAME_VIEW)) == -1))))
1376 contact_pos = "0 0 0";
1377 }
1378 }
1379
1381
1382 return contact_pos;
1383 }
1384
1386 {
1387 //if the hologram is too close to player when he looks to the sky, send the projection to away
1388 vector cam_dir = GetGame().GetCurrentCameraDirection();
1389
1390 if (cam_dir[1] > LOOKING_TO_SKY)
1391 pos = "0 0 0";
1392
1393 return pos;
1394 }
1395
1397 {
1398 if (m_Projection)
1399 return m_Projection.GetPosition();
1400
1401 return vector.Zero;
1402 }
1403
1405 {
1406 if (m_Projection)
1407 return m_Projection.GetOrientation();
1408
1409 return vector.Zero;
1410 }
1411
1413 {
1414 m_DefaultOrientation = GetGame().GetCurrentCameraDirection().VectorToAngles();
1415 m_DefaultOrientation[1] = 0;
1416
1417 if (!GetParentEntity().PlacementCanBeRotated())
1419
1420 return m_DefaultOrientation;
1421 }
1422
1423 int GetHiddenSelection(string selection)
1424 {
1425 int idx = m_Projection.GetHiddenSelectionIndex(selection);
1426
1427 if (idx != -1)
1428 return idx;
1429 else
1430 return 0;
1431 }
1432
1433 // the function accepts string
1434 void SetSelectionToRefresh(string selection)
1435 {
1436 m_SelectionsToRefresh.Insert(selection);
1437 }
1438
1439 //overloaded function to accept array of strings
1441 {
1442 foreach (string s : selection)
1443 m_SelectionsToRefresh.Insert(s);
1444 }
1445
1447 {
1448 if (m_Projection)
1449 {
1450 static const string textureName = "#(argb,8,8,3)color(0.5,0.5,0.5,0.75,ca)";
1451
1452 int hidden_selection = 0;
1453 string selection_to_refresh;
1454 string config_material = string.Format("CfgVehicles %1 hologramMaterial", m_Projection.GetType());
1455 string hologram_material = GetGame().ConfigGetTextOut(config_material);
1456 string config_model = string.Format("CfgVehicles %1 hologramMaterialPath", m_Projection.GetType());
1457 string hologram_material_path = string.Format("%1\\%2%3", GetGame().ConfigGetTextOut(config_model), hologram_material, CorrectMaterialPathName());
1458
1459 for (int i = 0; i < m_SelectionsToRefresh.Count(); ++i)
1460 {
1463 m_Projection.SetObjectTexture(hidden_selection, textureName);
1465 }
1466 }
1467 }
1468
1469 // Returns correct string to append to material path name
1471 {
1472 if (IsColliding() || IsFloating())
1474 else if (m_Parent.HasEnergyManager())
1475 {
1477 string SEL_CORD_PLUGGED = m_Parent.GetCompEM().SEL_CORD_PLUGGED;
1478 string SEL_CORD_FOLDED = m_Parent.GetCompEM().SEL_CORD_FOLDED;
1479
1480 if (comp_em.IsPlugged() && comp_em.IsEnergySourceAtReach(GetProjectionPosition()))
1481 {
1482 m_Projection.SetAnimationPhase(SEL_CORD_PLUGGED, 0);
1483 m_Projection.SetAnimationPhase(SEL_CORD_FOLDED, 1);
1485 }
1486 else
1487 {
1488 m_Projection.SetAnimationPhase(SEL_CORD_PLUGGED, 1);
1489 m_Projection.SetAnimationPhase(SEL_CORD_FOLDED, 0);
1490 }
1491 }
1492
1494 }
1495
1497 {
1498 if (m_Player.IsJumpInProgress())
1499 return true;
1500 if (m_Player.IsSwimming())
1501 return true;
1502 if (m_Player.IsClimbingLadder())
1503 return true;
1504 if (m_Player.IsRaised())
1505 return true;
1506 if (m_Player.IsClimbing())
1507 return true;
1508 if (m_Player.IsRestrained())
1509 return true;
1510 if (m_Player.IsUnconscious())
1511 return true;
1512
1513 return false;
1514 }
1515};
1516
1518{
1519 protected int m_TriggerUpdateMs;
1522
1523 override void OnEnter(Object obj)
1524 {
1525 //Print("OnEnter");
1526 if (m_ParentObj)
1527 {
1528 m_ParentObj.SetIsCollidingPlayer(true);
1529 m_TriggerUpdateMs = 50;
1530 }
1531 }
1532
1533 override void OnLeave(Object obj)
1534 {
1535 //Print("OnLeave");
1536 if (m_ParentObj)
1537 m_ParentObj.SetIsCollidingPlayer(false);
1538 }
1539
1540 override protected void UpdateInsiders(int timeout)
1541 {
1542 super.UpdateInsiders(m_TriggerUpdateMs);
1543 }
1544
1549
1551 {
1552 m_Player = player;
1553 }
1554}
eBleedingSourceType GetType()
const int ECE_OBJECT_SWAP
const int ECE_LOCAL
const int ECE_PLACE_ON_SURFACE
const int ECE_TRACE
const int ECE_CREATEPHYSICS
void DrawDebugCollisionBox(vector min_max[2], int color)
Shape m_CollisionBox
void DestroyDebugCollisionBox()
DayZGame g_Game
Definition DayZGame.c:3528
void DayZPlayerCamera3rdPerson(DayZPlayer pPlayer, HumanInputController pInput)
DiagMenuIDs
Definition EDiagMenuIDs.c:2
DayZPlayer m_Player
Definition Hand_Events.c:42
TrapBase m_ParentObj
Definition TrapTrigger.c:66
static bool GetDisableIsInTerrainCheck()
static bool GetDisableIsClippingRoofCheck()
static bool GetDisableIsUnderwaterCheck()
static bool GetDisableIsCollidingBBoxCheck()
static bool GetDisableHeightPlacementCheck()
static bool GetDisableIsPlacementPermittedCheck()
static bool GetDisableIsCollidingPlayerCheck()
static bool GetDisableIsCollidingGPlotCheck()
static bool GetDisableIsCollidingAngleCheck()
static bool GetDisableIsBaseViableCheck()
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
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 Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
Definition Debug.c:401
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Definition Debug.c:434
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:511
bool m_IsFloating
Definition Hologram.c:28
vector m_DefaultOrientation
Definition Hologram.c:32
const string ANIMATION_PLACING
Definition Hologram.c:37
vector GetCollisionBoxSize(vector min_max[2])
Definition Hologram.c:977
string CorrectMaterialPathName()
Definition Hologram.c:1470
void SetProjectionEntity(EntityAI projection)
Definition Hologram.c:1235
bool IsBaseIntact(Object under_left_close, Object under_right_close, Object under_left_far, Object under_right_far)
Definition Hologram.c:655
void SetAnimations()
Definition Hologram.c:161
string GetProjectionName(ItemBase item)
Definition Hologram.c:203
const string SELECTION_PLACING
Definition Hologram.c:39
bool m_IsHidden
Definition Hologram.c:30
const float LARGE_PROJECTION_DISTANCE_LIMIT
Deprecated.
Definition Hologram.c:45
void SetSelectionToRefresh(array< string > selection)
Definition Hologram.c:1440
bool IsCollidingZeroPos()
Definition Hologram.c:618
vector m_ContactDir
Definition Hologram.c:35
void SetSelectionToRefresh(string selection)
Definition Hologram.c:1434
void SetIsCollidingGPlot(bool is_colliding_gplot)
Definition Hologram.c:1268
const string SUFFIX_MATERIAL_DEPLOYABLE
Definition Hologram.c:14
bool IsInTerrain()
Definition Hologram.c:843
vector GetLeftFarProjectionVector()
Definition Hologram.c:1006
EntityAI m_Projection
Definition Hologram.c:19
const float PROJECTION_TRANSITION_MAX
Definition Hologram.c:47
bool GetUpdatePosition()
Definition Hologram.c:1225
void EvaluateCollision(ItemBase action_item=null)
Definition Hologram.c:393
vector m_YawPitchRollLimit
Definition Hologram.c:53
void SetUpdatePosition(bool state)
Definition Hologram.c:1220
bool HeightPlacementCheck()
Checks height relative to player's position.
Definition Hologram.c:776
EntityAI GetParentEntity()
Definition Hologram.c:1230
const float SMALL_PROJECTION_RADIUS
Definition Hologram.c:42
void CheckPowerSource()
Definition Hologram.c:930
vector m_y_p_r_previous
Definition Hologram.c:34
void Hologram(PlayerBase player, vector pos, ItemBase item)
Definition Hologram.c:65
void SetProjectionOrientation(vector orientation)
Definition Hologram.c:1312
void AddProjectionRotation(float addition)
Definition Hologram.c:1322
ItemBase m_Parent
Definition Hologram.c:18
vector HideWhenClose(vector pos)
Definition Hologram.c:1385
void CreateTrigger()
Definition Hologram.c:336
float m_SlopeTolerance
Definition Hologram.c:51
int m_ContactComponent
Definition Hologram.c:54
vector SetOnGround(vector position)
Definition Hologram.c:1332
bool IsObjectStatic(Object obj)
Definition Hologram.c:650
void ~Hologram()
Definition Hologram.c:145
void RefreshVisual()
Definition Hologram.c:1446
bool IsUnderwater()
Definition Hologram.c:800
bool IsCollidingAngle()
Definition Hologram.c:464
void UpdateHologram(float timeslice)
Definition Hologram.c:229
ref array< string > m_WatchtowerBlockedComponentNames
Definition Hologram.c:63
vector GetRightFarProjectionVector()
Definition Hologram.c:1015
void SetIsHidden(bool is_hidden)
Definition Hologram.c:1258
string m_ProjectionTypename
Definition Hologram.c:22
vector m_Rotation
Definition Hologram.c:33
ref set< string > m_SelectionsToRefresh
Definition Hologram.c:56
bool IsCollidingGPlot()
Definition Hologram.c:606
PlayerBase m_Player
Definition Hologram.c:20
const float DISTANCE_SMALL_PROJECTION
Definition Hologram.c:44
void RefreshTrigger()
Definition Hologram.c:347
bool IsPlacementPermitted()
Checks if the item can be legally placed (usually checked by action as well)
Definition Hologram.c:762
bool IsCollidingBBox(ItemBase action_item=null)
Definition Hologram.c:497
bool IsColliding()
Definition Hologram.c:1281
static bool DoesHaveProjection(ItemBase item)
DEPRECATED.
Definition Hologram.c:223
vector SmoothProjectionMovement(vector y_p_r, float timeslice)
Definition Hologram.c:313
bool m_UpdatePosition
Definition Hologram.c:29
bool IsSurfaceWater(vector position)
Definition Hologram.c:1025
vector m_FromAdjusted
Definition Hologram.c:36
bool IsBaseViable()
Definition Hologram.c:544
bool m_AlignToTerrain
Definition Hologram.c:52
bool SetHologramPosition(vector startPosition, float minProjectionDistance, float maxProjectionDistance, inout vector contactPosition)
Sets hologram position based on player and projection distance.
Definition Hologram.c:1122
vector GetLeftCloseProjectionVector()
Definition Hologram.c:988
void SetIsColliding(bool is_colliding)
Definition Hologram.c:1250
vector GetProjectionOrientation()
Definition Hologram.c:1404
bool IsSurfaceSea(vector position)
Definition Hologram.c:1031
void SubtractProjectionRotation(float subtraction)
Definition Hologram.c:1327
vector GetRightCloseProjectionVector()
Definition Hologram.c:996
int GetHiddenSelection(string selection)
Definition Hologram.c:1423
bool IsCollidingPlayer()
Definition Hologram.c:1294
const string SUFFIX_MATERIAL_UNDEPLOYABLE
Definition Hologram.c:15
bool m_IsColliding
Definition Hologram.c:24
vector AlignProjectionOnTerrain(float timeslice)
Definition Hologram.c:266
vector GetProjectionEntityPosition(PlayerBase player)
Definition Hologram.c:1037
ProjectionTrigger m_ProjectionTrigger
Definition Hologram.c:21
bool IsFenceOrWatchtowerKit()
Definition Hologram.c:1171
EntityAI GetProjectionEntity()
Definition Hologram.c:1240
bool IsProjectionTrap()
Definition Hologram.c:1186
static const float DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF
Definition Hologram.c:49
bool IsBaseFlat(vector contact_pos_left_close, vector contact_pos_right_close, vector contact_pos_left_far, vector contact_pos_right_far)
Definition Hologram.c:741
void SetIsCollidingPlayer(bool is_colliding)
Definition Hologram.c:1263
void SetIsFloating(bool is_floating)
Definition Hologram.c:1245
const float SMALL_PROJECTION_GROUND
Definition Hologram.c:43
vector CorrectForWatchtower(int contactComponent, vector contactPos, PlayerBase player, Object hitObject)
Definition Hologram.c:1176
float GetProjectionRadius()
Definition Hologram.c:1205
vector GetProjectionRotation()
Definition Hologram.c:1317
bool m_IsCollidingGPlot
Definition Hologram.c:25
bool IsClippingRoof()
Definition Hologram.c:432
bool IsBehindObstacle()
DEPRECATED.
Definition Hologram.c:630
const int SPAWN_FLAGS
Definition Hologram.c:6
void GetProjectionCollisionBox(out vector min_max[2])
Definition Hologram.c:966
float GetProjectionDiameter()
Definition Hologram.c:1191
const float LOOKING_TO_SKY
Definition Hologram.c:48
string ProjectionBasedOnParent()
Definition Hologram.c:198
ref array< string > m_WatchtowerIgnoreComponentNames
Definition Hologram.c:60
void UpdateSelections()
Definition Hologram.c:179
bool m_IsCollidingPlayer
Definition Hologram.c:27
vector GetProjectionPosition()
Definition Hologram.c:1396
bool m_IsSlope
Definition Hologram.c:26
bool IsHidden()
Definition Hologram.c:1286
void SetProjectionPosition(vector position)
Definition Hologram.c:1304
vector GetDefaultOrientation()
Definition Hologram.c:1412
const float PROJECTION_TRANSITION_MIN
Definition Hologram.c:46
const string SELECTION_INVENTORY
Definition Hologram.c:40
const string ANIMATION_INVENTORY
Definition Hologram.c:38
EntityAI PlaceEntity(EntityAI entity_for_placing)
Definition Hologram.c:947
bool IsFloating()
Definition Hologram.c:1273
bool IsBaseStatic(Object objectToCheck)
Definition Hologram.c:637
const string SUFFIX_MATERIAL_POWERED
Definition Hologram.c:16
bool IsRestrictedFromAdvancedPlacing()
Definition Hologram.c:1496
override bool IsBasebuildingKit()
Definition KitBase.c:17
const string SEL_CORD_PLUGGED
const string SEL_CORD_FOLDED
override bool CanBePlaced(Man player, vector position)
Definition TentBase.c:917
LOD class.
Definition gameplay.c:203
static const string NAME_VIEW
Definition gameplay.c:206
Definition EnMath.c:7
Scripted Trigger.
Definition Hologram.c:1518
override void OnLeave(Object obj)
Definition Hologram.c:1533
override void OnEnter(Object obj)
Definition Hologram.c:1523
void SetParentOwner(PlayerBase player)
Definition Hologram.c:1550
void UpdateInsiders(int timeout)
Definition Hologram.c:1540
Hologram m_ParentObj
Definition Hologram.c:1520
PlayerBase m_Player
Definition Hologram.c:1521
void SetParentObject(Hologram projection)
Definition Hologram.c:1545
int m_TriggerUpdateMs
Definition Hologram.c:1519
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native float Length()
Returns length of vector (magnitude)
static const vector Zero
Definition EnConvert.c:110
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
const int COLOR_RED
Definition constants.c:64
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx
CollisionFlags
Definition EnDebug.c:141
ShapeFlags
Definition EnDebug.c:126
static proto void InputFloat(string txt, out float value, int pxWidth=150)
static proto native void SameLine()
static proto native void ColoredText(int color, string label)
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
const float ROOF_CHECK_RAYCAST_DIST
Definition constants.c:867
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int LIQUID_WATER
Definition constants.c:504
static proto vector MatrixToAngles(vector mat[3])
Returns angles of rotation matrix.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto void MatrixMultiply3(vector mat0[3], vector mat1[3], out vector res[3])
Transforms rotation matrix.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float AbsFloat(float f)
Returns absolute value.