Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignBuildingPlacingObstructionEditorComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Editor", description: "Placing obstruction. Disallow placing of the composition in define cases.", icon: "WBData/ComponentEditorProps/componentEditor.png")]
3 {
4 
5 }
6 
13 class SCR_CampaignBuildingPlacingObstructionEditorComponent : SCR_BaseEditorComponent
14 {
15  [Attribute(defvalue: "20", desc: "Entity tilt greater then this value in angles will trigger a warning.")]
16  protected float m_fEntityTiltWarning;
17 
18  [Attribute(defvalue: "25", desc: "A difference between max and min tilt of two entities in composition to trigger a warning")]
19  protected float m_fTiltDifferenceWarning;
20 
21  protected ResourceName m_sCompositionResourceName;
22 
23  protected bool m_bCanBeCreated = true;
24  protected bool m_bSuperiorCanBeCreated = false;
25  protected bool m_bTraceEntityPosition;
26  protected SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent;
30  protected ref array<ref Tuple3<IEntity, float, vector>> m_aCompositionEntities = {};
31 
32  //Adding this value to a sea level as the composition preview, even above sea doesn't have it's Y value exactly a zero.
33  protected const float SEA_LEVEL_OFFSET = 0.01;
34 
35  // With the preview we don't need to be that strict as it is sometimes even wanted to have an entities tide together for an example row of sandbag walls.
36  protected const float PREVIEW_CHECK_FACTOR = 0.1;
37 
38  // The heigh above the ground where the trace stops means it will ignore an entities that are close to surface like sidewalks so they don't block the placement.
39  protected const float HEIGHT_ABOVE_GROUND_BUFFER = 0.3;
40  protected const float HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER = 1;
41 
42  protected const float BOUNDING_BOX_FACTOR = 0.5;
43  protected const float BOUNDING_BOX_VEHICLE_FACTOR = 0.8;
44  protected const float MINIMAL_PROTECTION_RADIUS_TO_EVALUATE = 0.2;
45  protected const float MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE = 1;
46  protected const int MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT = 1;
47  protected float m_fSafeZoneRadius = 0;
48  protected float m_fCylinderHeight = 0.5;
49  protected float m_fRollMin;
50  protected float m_fRollMax;
51  protected float m_fPitchMin;
52  protected float m_fPitchMax;
53  protected bool m_bIsVehicle;
54 
55  protected vector m_vTraceOffset = Vector(0, 10, 0);
56  protected vector m_vCylinderVectorOffset = Vector(0, m_fCylinderHeight * 0.5, 0);
57 
58  //------------------------------------------------------------------------------------------------
59  override protected void EOnEditorActivate()
60  {
61  InitVariables();
62  }
63 
64  //------------------------------------------------------------------------------------------------
65  override protected void EOnEditorActivateServer()
66  {
67  InitVariables();
68  }
69 
70  //------------------------------------------------------------------------------------------------
71  override protected void EOnEditorOpen()
72  {
73  InitVariables();
74 
75  SCR_CampaignBuildingEditorComponent CampaignBuildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
76  if (!CampaignBuildingEditorComponent)
77  return;
78 
79  CampaignBuildingEditorComponent.GetOnObstructionEventTriggered().Insert(SetSuperiorCanBeCreated);
80  }
81 
82  //------------------------------------------------------------------------------------------------
83  override protected void EOnEditorClose()
84  {
85  SCR_CampaignBuildingEditorComponent CampaignBuildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
86  if (!CampaignBuildingEditorComponent)
87  return;
88 
89  CampaignBuildingEditorComponent.GetOnObstructionEventTriggered().Remove(SetSuperiorCanBeCreated);
90  }
91 
92  //------------------------------------------------------------------------------------------------
93  override protected void EOnEditorOpenServer()
94  {
95  InitVariables();
96  }
97 
98  //------------------------------------------------------------------------------------------------
101  {
103  if (PreviewEntityComponent)
104  PreviewEntityComponent.SetLastPreviewState(SCR_EPreviewState.NONE);
105 
106  m_PreviewEnt = previewEnt;
107  SetInitialCanBeCreatedState(previewEnt);
108  GetAllEntitiesToEvaluate(previewEnt);
109 
110  SCR_CampaignBuildingPlacingEditorComponent placingComponent = SCR_CampaignBuildingPlacingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingEditorComponent, true, true));
111  if (!placingComponent)
112  return;
113 
114  m_sCompositionResourceName = placingComponent.GetSelectedPrefab();
115  }
116 
117  //------------------------------------------------------------------------------------------------
120  {
121  return m_bCanBeCreated;
122  }
123 
124  //------------------------------------------------------------------------------------------------
126  void SetSuperiorCanBeCreated(bool val)
127  {
128  m_bSuperiorCanBeCreated = val;
129  }
130 
131  //------------------------------------------------------------------------------------------------
133  protected void SetInitialCanBeCreatedState(notnull SCR_EditablePreviewEntity previewEnt)
134  {
135  if (!previewEnt)
136  return;
137 
138  float distance = vector.DistanceSq(m_AreaTrigger.GetOrigin(), previewEnt.GetOrigin());
139  if (distance < m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius())
140  m_bCanBeCreated = true;
141 
142  m_bCanBeCreated = false;
144  return;
145  }
146 
147  //------------------------------------------------------------------------------------------------
148  private void InitVariables()
149  {
150  m_CampaignBuildingComponent = SCR_CampaignBuildingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingEditorComponent, true, true));
152  return;
153 
155  }
156 
157  //------------------------------------------------------------------------------------------------
158  // Check if the preview is outisde of the building radius. if preview doesn't exist return false - preview doesn't exist on server and the same CanCreateEntity is used on server too.
159  bool IsPreviewOutOfRange(out ENotification outNotification = -1)
160  {
161  if (!m_AreaTrigger || !m_PreviewEnt)
162  return false;
163 
164  if ((vector.DistanceSqXZ(m_AreaTrigger.GetOrigin(), m_PreviewEnt.GetOrigin()) >= m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius()))
165  {
166  outNotification = ENotification.EDITOR_PLACING_OUT_OF_CAMPAIGN_BUILDING_ZONE;
167  return true;
168  }
169 
170  return false;
171  }
172 
173  //------------------------------------------------------------------------------------------------
174  // Make an array of all entities to evaluate
175  protected void GetAllEntitiesToEvaluate(notnull SCR_EditablePreviewEntity rootEnt)
176  {
177  m_aCompositionEntities.Clear();
178  array<IEntity> compositionEntities = {};
179  vector entityOrigin[4];
180 
181  SCR_EntityHelper.GetHierarchyEntityList(rootEnt, compositionEntities);
182 
183  foreach (IEntity ent : compositionEntities)
184  {
185  if (IsPreviewVehicle(ent))
186  m_bIsVehicle = true;
187 
188  // Center of the entity is burrided under the ground (fondations) skip it)
189  vector entityCenter;
190  entityCenter = SCR_EntityHelper.GetEntityCenterWorld(ent);
191  if (entityCenter[1] < 0)
192  continue;
193 
194  float protectionRadius = GetEntityProtectionRadius(ent);
195 
196  if (protectionRadius > 0)
197  {
198 
199  ent.GetLocalTransform(entityOrigin);
200  // If the entity is too small or in the air (props on tables etc) ignore it in test
201  if (protectionRadius < MINIMAL_PROTECTION_RADIUS_TO_EVALUATE || entityOrigin[3][1] > MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE)
202  continue;
203 
204  vector entityWorldTransform[4];
205  ent.GetWorldTransform(entityWorldTransform);
206  vector transformAngles = Math3D.MatrixToAngles(entityWorldTransform);
207 
208  m_aCompositionEntities.Insert(new Tuple3<IEntity, float, vector>(ent, protectionRadius, transformAngles));
209  }
210  }
211  }
212 
213  //------------------------------------------------------------------------------------------------
215  bool IsPreviewVehicle(IEntity ent)
216  {
217  SCR_EditablePreviewComponent previewEditableEntity = SCR_EditablePreviewComponent.Cast(ent.FindComponent(SCR_EditablePreviewComponent));
218  if (!previewEditableEntity)
219  return false;
220 
221  SCR_EditableEntityUIInfo editableUiInfo = SCR_EditableEntityUIInfo.Cast(previewEditableEntity.GetInfo());
222 
223  return editableUiInfo && editableUiInfo.HasEntityLabel(EEditableEntityType.VEHICLE) && !editableUiInfo.HasEntityLabel(EEditableEntityLabel.VEHICLE_HELICOPTER);
224  }
225 
226  //------------------------------------------------------------------------------------------------
228  bool CanCreate(out ENotification outNotification = -1, out SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE)
229  {
230  // superior can be created was set to false which means some external condition block placing the composition. No need to continue with any evaluation.
231  if (m_bSuperiorCanBeCreated)
232  {
233  outNotification = ENotification.EDITOR_PLACING_BLOCKED;
234  previewStateToShow = SCR_EPreviewState.BLOCKED;
235  return false;
236  }
237 
238  m_bCanBeCreated = true;
239  m_fRollMin = 0;
240  m_fRollMax = 0;
241  m_fPitchMin = 0;
242  m_fPitchMax = 0;
243 
244  if (m_bIsVehicle)
245  {
246  if (!CheckVehiclePosition())
247  {
248  m_bCanBeCreated = false;
249  outNotification = ENotification.EDITOR_PLACING_BLOCKED;
250  previewStateToShow = SCR_EPreviewState.BLOCKED;
251  }
252 
253  return m_bCanBeCreated;
254  }
255 
256  foreach (Tuple3<IEntity, float, vector> compositionEntity : m_aCompositionEntities)
257  {
258  if (compositionEntity.param1 && !CheckEntityPosition(compositionEntity.param1.GetOrigin(), compositionEntity.param2))
259  {
260  m_bCanBeCreated = false;
261  outNotification = ENotification.EDITOR_PLACING_BLOCKED;
262  previewStateToShow = SCR_EPreviewState.BLOCKED;
263  break;
264  }
265 
266  if (compositionEntity.param2 < MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT)
267  continue;
268 
269  if (IsCompositionTilted(compositionEntity.param1, compositionEntity.param2, compositionEntity.param3, previewStateToShow))
270  break;
271  }
272 
273  if (Math.AbsFloat(m_fRollMax - m_fRollMin) > m_fTiltDifferenceWarning)
274  previewStateToShow = SCR_EPreviewState.WARNING;
275 
276  if (Math.AbsFloat(m_fPitchMax - m_fPitchMin) > m_fTiltDifferenceWarning)
277  previewStateToShow = SCR_EPreviewState.WARNING;
278 
279  return m_bCanBeCreated;
280  }
281 
282  //------------------------------------------------------------------------------------------------
284  protected float GetEntityProtectionRadius(notnull IEntity ent)
285  {
286  vector vectorMin, vectorMax;
287  ent.GetBounds(vectorMin, vectorMax);
288  return vector.DistanceXZ(vectorMin, vectorMax) * BOUNDING_BOX_FACTOR;
289  }
290 
291  //------------------------------------------------------------------------------------------------
293  protected bool IsCompositionTilted(IEntity ent, float entityRadius, vector originalTransofrmAngles, out SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE)
294  {
295  vector transformMat[4];
296  ent.GetWorldTransform(transformMat);
297 
298  vector transformAngles = Math3D.MatrixToAngles(transformMat);
299  vector transformAnglesToTest = transformAngles - originalTransofrmAngles;
300 
301  if (transformAnglesToTest[1] < -m_fEntityTiltWarning || transformAnglesToTest[1] > m_fEntityTiltWarning)
302  {
303  previewStateToShow = SCR_EPreviewState.WARNING;
304  return true;
305  }
306 
307  if (transformAnglesToTest[2] < -m_fEntityTiltWarning || transformAnglesToTest[2] > m_fEntityTiltWarning)
308  {
309  previewStateToShow = SCR_EPreviewState.WARNING;
310  return true;
311  }
312 
313  // The tilt of the entity itself is withing the range. But save it's value to compare min and max of whole composition later to see if the maximum difference isn't triggered.
314  if (transformAnglesToTest[1] < m_fRollMin)
315  m_fRollMin = transformAnglesToTest[1];
316 
317  if (transformAnglesToTest[1] > m_fRollMax)
318  m_fRollMax = transformAnglesToTest[1];
319 
320  if (transformAnglesToTest[2] < m_fPitchMin)
321  m_fPitchMin = transformAnglesToTest[2];
322 
323  if (transformAnglesToTest[2] > m_fPitchMax)
324  m_fPitchMax = transformAnglesToTest[2];
325 
326  return false;
327  }
328 
329  //------------------------------------------------------------------------------------------------
331  protected bool CheckEntityPosition(vector pos, float safeZoneRadius)
332  {
333  m_bTraceEntityPosition = true;
334 
335  BaseWorld world = GetGame().GetWorld();
336  if (!world)
337  return false;
338 
339  m_fSafeZoneRadius = safeZoneRadius;
340 
341  // First do the sea level check as it is cheep and don't need to continue with trace if the composition is in the sea.
342  float val = world.GetOceanBaseHeight();
343  if (pos[1] < world.GetOceanBaseHeight() + SEA_LEVEL_OFFSET)
344  return false;
345 
346  // No check for the nearby previews as we don't want to allow player to build a cliping compositions
347  if (!world.QueryEntitiesBySphere(pos, safeZoneRadius * PREVIEW_CHECK_FACTOR, EvaluateBlockingEntity))
348  return false;
349 
350  // Check for solid obstacles such as houses, vehciles, other palyers etc.
351  if (m_bTraceEntityPosition && TraceEntityOnPosition(pos, world, safeZoneRadius))
352  return false;
353 
354  // Check if the placing isn't blocked because the origin of the preview is in water.
355  return !ChimeraWorldUtils.TryGetWaterSurfaceSimple(world, pos);
356  }
357 
358  //------------------------------------------------------------------------------------------------
360  protected bool CheckVehiclePosition()
361  {
362  if (!m_PreviewEnt)
363  return false;
364 
365  BaseWorld world = GetGame().GetWorld();
366  if (!world)
367  return false;
368 
369  vector transform[4];
370  m_PreviewEnt.GetTransform(transform);
371 
372  vector outBoundMin, outBoundMax;
373  m_PreviewEnt.GetPreviewBounds(outBoundMin, outBoundMax);
374  outBoundMin[1] = HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER;
375  outBoundMin[0] = outBoundMin[0] * BOUNDING_BOX_VEHICLE_FACTOR;
376  outBoundMin[2] = outBoundMin[2] * BOUNDING_BOX_VEHICLE_FACTOR;
377 
378  return world.QueryEntitiesByOBB(outBoundMin, outBoundMax, transform, EvaluateBlockingEntityVehicle);
379  }
380 
381  //------------------------------------------------------------------------------------------------
384  bool EvaluateBlockingEntity(IEntity ent)
385  {
386  if (!ent)
387  return true;
388 
389  if (HasObstructionException(ent))
390  return true;
391 
392  IEntity rootEnt = SCR_EntityHelper.GetMainParent(ent);
393  if (!rootEnt)
394  return true;
395 
396  SCR_BasePreviewEntity previewEnt = SCR_BasePreviewEntity.Cast(ent);
397  if (!previewEnt)
398  return true;
399 
400  SCR_EditablePreviewEntity ePrevEnt = SCR_EditablePreviewEntity.Cast(rootEnt);
401 
402  return ePrevEnt && m_PreviewEnt == ePrevEnt;
403  }
404 
405  //------------------------------------------------------------------------------------------------
409  {
410  if (!ent)
411  return true;
412 
413  SCR_BasePreviewEntity previewEnt = SCR_BasePreviewEntity.Cast(ent);
414  if (previewEnt)
415  return true;
416 
417  if (!ent.GetPhysics())
418  return true;
419 
420  return HasObstructionException(ent);
421  }
422 
423  //------------------------------------------------------------------------------------------------
425  bool HasObstructionException(notnull IEntity ent)
426  {
427  SCR_CampaignBuildingObstructionExceptionComponent obstructionException = SCR_CampaignBuildingObstructionExceptionComponent.Cast(ent.FindComponent(SCR_CampaignBuildingObstructionExceptionComponent));
428  if (!obstructionException)
429  return false;
430 
431  // the whitelist is empty means any prefab can colide with this entity. If set check if this entity is on the list of those that can colide.
432  if (obstructionException.IsWhitelistEmpty() || obstructionException.IsOnWhitelist(m_sCompositionResourceName))
433  {
434  m_bTraceEntityPosition = false;
435  return true;
436  }
437 
438  return false;
439  }
440 
441  //------------------------------------------------------------------------------------------------
443  protected bool TraceEntityOnPosition(vector position, notnull BaseWorld world, float safeZoneRadius)
444  {
445  TraceParam trace = new TraceParam();
446  trace.Start = position;
447  trace.End = position - m_vTraceOffset;
448  trace.Flags = TraceFlags.ENTS | TraceFlags.OCEAN | TraceFlags.WORLD;
449  float traceCoef = world.TraceMove(trace, null);
450  position[1] = Math.Max(trace.Start[1] - traceCoef * m_vTraceOffset[1] + 0.01, world.GetSurfaceY(position[0], position[2]) + HEIGHT_ABOVE_GROUND_BUFFER);
451 
452  if (TraceCylinder(position + m_vCylinderVectorOffset, safeZoneRadius, m_fCylinderHeight, TraceFlags.ENTS, world))
453  return false;
454 
456  return true;
457  }
458 
459  //------------------------------------------------------------------------------------------------
470  bool TraceCylinder(vector pos, float radius = 0.5, float height = 2, TraceFlags flags = TraceFlags.ENTS | TraceFlags.OCEAN, BaseWorld world = null)
471  {
472  if (!world)
473  world = GetGame().GetWorld();
474 
475  float heightHalf = height * 0.5;
476 
477  TraceParam trace = new TraceParam();
478  trace.Flags = flags;
479 
480  vector dir = {radius, heightHalf, 0};
481  trace.Start = pos + dir;
482  trace.End = pos - dir;
483  if (world.TraceMove(trace, null) < 1)
484  return false;
485 
486  dir = {-radius, heightHalf, 0};
487  trace.Start = pos + dir;
488  trace.End = pos - dir;
489  if (world.TraceMove(trace, null) < 1)
490  return false;
491 
492  dir = {0, heightHalf, radius};
493  trace.Start = pos + dir;
494  trace.End = pos - dir;
495  if (world.TraceMove(trace, null) < 1)
496  return false;
497 
498  dir = {0, heightHalf, -radius};
499  trace.Start = pos + dir;
500  trace.End = pos - dir;
501  if (world.TraceMove(trace, null) < 1)
502  return false;
503 
504  return true;
505  }
506 }
EvaluateBlockingEntityVehicle
bool EvaluateBlockingEntityVehicle(IEntity ent)
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:408
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
EEditableEntityLabel
EEditableEntityLabel
Definition: EEditableEntityLabel.c:1
m_fRollMax
protected float m_fRollMax
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:50
ECantBuildNotificationType
ECantBuildNotificationType
Definition: SCR_CampaignBuildingPlacingEditorComponent.c:430
CheckEntityPosition
protected bool CheckEntityPosition(vector pos, float safeZoneRadius)
Check entity position in given radius.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:331
m_bCanBeCreated
protected bool m_bCanBeCreated
Definition: SCR_CampaignBuildingPlacingEditorComponent.c:25
SCR_EntityHelper
Definition: SCR_EntityHelper.c:1
CheckVehiclePosition
protected bool CheckVehiclePosition()
Check entity position in given bounding box.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:360
SetInitialCanBeCreatedState
protected void SetInitialCanBeCreatedState(notnull SCR_EditablePreviewEntity previewEnt)
Set the initial state of the preview can / can't be created (based on the place where player place th...
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:133
PREVIEW_CHECK_FACTOR
const protected float PREVIEW_CHECK_FACTOR
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:36
SCR_EditablePreviewEntity
Definition: SCR_EditablePreviewEntity.c:8
IsCompositionTilted
protected bool IsCompositionTilted(IEntity ent, float entityRadius, vector originalTransofrmAngles, out SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE)
Check the tilt of the entities in compositions. If it goes over the set limits, the colour of preview...
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:293
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SetSuperiorCanBeCreated
void SetSuperiorCanBeCreated(bool val)
Set if the entity can be created, outside of the obstruction system. This is superior to internal m_b...
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:126
m_fPitchMax
protected float m_fPitchMax
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:52
m_fRollMin
protected float m_fRollMin
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:49
SCR_EditableEntityUIInfo
Definition: SCR_EditableEntityUIInfo.c:2
TraceCylinder
bool TraceCylinder(vector pos, float radius=0.5, float height=2, TraceFlags flags=TraceFlags.ENTS|TraceFlags.OCEAN, BaseWorld world=null)
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:470
SCR_BasePreviewEntity
Definition: SCR_BasePreviewEntity.c:9
m_eBlockingReason
protected ECantBuildNotificationType m_eBlockingReason
Definition: SCR_CampaignBuildingPlacingEditorComponent.c:29
GetAllEntitiesToEvaluate
protected void GetAllEntitiesToEvaluate(notnull SCR_EditablePreviewEntity rootEnt)
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:175
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_EPreviewState
SCR_EPreviewState
Definition: SCR_PreviewEntityEditorComponent.c:1138
MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT
const protected int MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:46
IsPreviewVehicle
bool IsPreviewVehicle(IEntity ent)
Check the given preview is vehicle.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:215
HEIGHT_ABOVE_GROUND_BUFFER
const protected float HEIGHT_ABOVE_GROUND_BUFFER
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:39
m_PreviewEnt
protected SCR_EditablePreviewEntity m_PreviewEnt
Definition: SCR_CampaignBuildingPlacingEditorComponent.c:30
SEA_LEVEL_OFFSET
const protected float SEA_LEVEL_OFFSET
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:33
SCR_CampaignBuildingPlacingObstructionEditorComponentClass
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:2
m_vTraceOffset
protected vector m_vTraceOffset
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:55
MINIMAL_PROTECTION_RADIUS_TO_EVALUATE
const protected float MINIMAL_PROTECTION_RADIUS_TO_EVALUATE
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:44
ENotification
ENotification
Definition: ENotification.c:4
SCR_FreeRoamBuildingClientTriggerEntity
Definition: SCR_FreeRoamBuildingClientTriggerEntity.c:6
SCR_BaseEditorComponent
Definition: SCR_BaseEditorComponent.c:119
m_vCylinderVectorOffset
protected vector m_vCylinderVectorOffset
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:56
distance
float distance
Definition: SCR_DestructibleTreeV2.c:29
m_CampaignBuildingComponent
protected SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent
Definition: SCR_CampaignBuildingBudgetEditorComponent.c:9
HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER
const protected float HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:40
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
OnPreviewCreated
void OnPreviewCreated(notnull SCR_EditablePreviewEntity previewEnt)
Method called once the preview is spawned to initiate all the variables and start evaluate the obstru...
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:100
EvaluateBlockingEntity
bool EvaluateBlockingEntity(IEntity ent)
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:384
TraceEntityOnPosition
protected bool TraceEntityOnPosition(vector position, notnull BaseWorld world, float safeZoneRadius)
Trace at the position of the preview to find any possibly cliping entities.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:443
MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE
const protected float MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:45
IsPreviewOutOfRange
bool IsPreviewOutOfRange(out ENotification outNotification=-1)
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:159
BOUNDING_BOX_FACTOR
const protected float BOUNDING_BOX_FACTOR
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:42
SCR_BaseEditorComponentClass
Definition: SCR_BaseEditorComponent.c:2
m_AreaTrigger
protected SCR_FreeRoamBuildingClientTriggerEntity m_AreaTrigger
Definition: SCR_CampaignBuildingPlacingEditorComponent.c:27
m_bIsVehicle
protected bool m_bIsVehicle
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:53
EOnEditorClose
override protected void EOnEditorClose()
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:83
Attribute
SCR_CampaignBuildingPlacingObstructionEditorComponentClass SCR_BaseEditorComponentClass Attribute(defvalue:"20", desc:"Entity tilt greater then this value in angles will trigger a warning.")
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:15
InitVariables
private void InitVariables()
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:148
BOUNDING_BOX_VEHICLE_FACTOR
const protected float BOUNDING_BOX_VEHICLE_FACTOR
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:43
EOnEditorOpenServer
override protected void EOnEditorOpenServer()
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:93
GetEntityProtectionRadius
protected float GetEntityProtectionRadius(notnull IEntity ent)
Calculate a sphere radius about the entity which will be tested for obstruction.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:284
HasObstructionException
bool HasObstructionException(notnull IEntity ent)
Check if detected entity has set any obstruction exception rulles.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:425
CanBeCreated
bool CanBeCreated()
Return current canbeCreated value.
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:119
EOnEditorOpen
override protected void EOnEditorOpen()
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:71
m_fCylinderHeight
protected float m_fCylinderHeight
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:48
EOnEditorActivateServer
override protected void EOnEditorActivateServer()
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:65
EOnEditorActivate
override protected void EOnEditorActivate()
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:59
position
vector position
Definition: SCR_DestructibleTreeV2.c:30
CanCreate
bool CanCreate(out ENotification outNotification=-1, out SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE)
Check the preview position. Is suitable to build the composition here?
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:228
ChimeraWorldUtils
Definition: ChimeraWorldUtils.c:7
m_fSafeZoneRadius
protected float m_fSafeZoneRadius
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:47
m_fPitchMin
protected float m_fPitchMin
Definition: SCR_CampaignBuildingPlacingObstructionEditorComponent.c:51
SCR_PreviewEntityEditorComponent
Definition: SCR_PreviewEntityEditorComponent.c:12
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180