Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignBuildingPlacingObstructionEditorComponent.c File Reference

Go to the source code of this file.

Data Structures

class  SCR_CampaignBuildingPlacingObstructionEditorComponentClass
 

Functions

SCR_CampaignBuildingPlacingObstructionEditorComponentClass SCR_BaseEditorComponentClass Attribute (defvalue:"20", desc:"Entity tilt greater then this value in angles will trigger a warning.")
 
override protected void EOnEditorActivate ()
 
override protected void EOnEditorActivateServer ()
 
override protected void EOnEditorOpen ()
 
override protected void EOnEditorClose ()
 
override protected void EOnEditorOpenServer ()
 
void OnPreviewCreated (notnull SCR_EditablePreviewEntity previewEnt)
 Method called once the preview is spawned to initiate all the variables and start evaluate the obstruction. More...
 
bool CanBeCreated ()
 Return current canbeCreated value. More...
 
void SetSuperiorCanBeCreated (bool val)
 Set if the entity can be created, outside of the obstruction system. This is superior to internal m_bCanBeCreated. More...
 
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 the preview into the world.) More...
 
private void InitVariables ()
 
bool IsPreviewOutOfRange (out ENotification outNotification=-1)
 
protected void GetAllEntitiesToEvaluate (notnull SCR_EditablePreviewEntity rootEnt)
 
bool IsPreviewVehicle (IEntity ent)
 Check the given preview is vehicle. More...
 
bool CanCreate (out ENotification outNotification=-1, out SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE)
 Check the preview position. Is suitable to build the composition here? More...
 
protected float GetEntityProtectionRadius (notnull IEntity ent)
 Calculate a sphere radius about the entity which will be tested for obstruction. More...
 
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 material will be changed to warn player. More...
 
protected bool CheckEntityPosition (vector pos, float safeZoneRadius)
 Check entity position in given radius. More...
 
protected bool CheckVehiclePosition ()
 Check entity position in given bounding box. More...
 
bool EvaluateBlockingEntity (IEntity ent)
 
bool EvaluateBlockingEntityVehicle (IEntity ent)
 
bool HasObstructionException (notnull IEntity ent)
 Check if detected entity has set any obstruction exception rulles. More...
 
protected bool TraceEntityOnPosition (vector position, notnull BaseWorld world, float safeZoneRadius)
 Trace at the position of the preview to find any possibly cliping entities. More...
 
bool TraceCylinder (vector pos, float radius=0.5, float height=2, TraceFlags flags=TraceFlags.ENTS|TraceFlags.OCEAN, BaseWorld world=null)
 

Variables

const protected float SEA_LEVEL_OFFSET = 0.01
 
const protected float PREVIEW_CHECK_FACTOR = 0.1
 
const protected float HEIGHT_ABOVE_GROUND_BUFFER = 0.3
 
const protected float HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER = 1
 
const protected float BOUNDING_BOX_FACTOR = 0.5
 
const protected float BOUNDING_BOX_VEHICLE_FACTOR = 0.8
 
const protected float MINIMAL_PROTECTION_RADIUS_TO_EVALUATE = 0.2
 
const protected float MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE = 1
 
const protected int MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT = 1
 
protected float m_fSafeZoneRadius = 0
 
protected float m_fCylinderHeight = 0.5
 
protected float m_fRollMin
 
protected float m_fRollMax
 
protected float m_fPitchMin
 
protected float m_fPitchMax
 
protected bool m_bIsVehicle
 
protected vector m_vTraceOffset = Vector(0, 10, 0)
 
protected vector m_vCylinderVectorOffset = Vector(0, m_fCylinderHeight * 0.5, 0)
 

Function Documentation

◆ CanBeCreated()

bool CanBeCreated ( )

Return current canbeCreated value.

Definition at line 119 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ 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 at line 228 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ CheckEntityPosition()

protected bool CheckEntityPosition ( vector  pos,
float  safeZoneRadius 
)

Check entity position in given radius.

Definition at line 331 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ CheckVehiclePosition()

protected bool CheckVehiclePosition ( )

Check entity position in given bounding box.

Definition at line 360 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ EOnEditorActivate()

override protected void EOnEditorActivate ( )

◆ EOnEditorActivateServer()

override protected void EOnEditorActivateServer ( )

◆ EOnEditorClose()

override protected void EOnEditorClose ( )

◆ EOnEditorOpen()

override protected void EOnEditorOpen ( )

◆ EOnEditorOpenServer()

override protected void EOnEditorOpenServer ( )

◆ EvaluateBlockingEntity()

bool EvaluateBlockingEntity ( IEntity  ent)

Evaluate the entity query found if it really can blocks the spawning of the composition.

Parameters
[in]entEntity found during query as potential obstacel to placing.

Definition at line 384 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ EvaluateBlockingEntityVehicle()

bool EvaluateBlockingEntityVehicle ( IEntity  ent)

Evaluate blocking entities for vehicles.

Parameters
[in]entEntity found during query as potential obstacel to placing.

Definition at line 408 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ GetAllEntitiesToEvaluate()

protected void GetAllEntitiesToEvaluate ( notnull SCR_EditablePreviewEntity  rootEnt)

◆ GetEntityProtectionRadius()

protected float GetEntityProtectionRadius ( notnull IEntity  ent)

Calculate a sphere radius about the entity which will be tested for obstruction.

Definition at line 284 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ HasObstructionException()

bool HasObstructionException ( notnull IEntity  ent)

Check if detected entity has set any obstruction exception rulles.

Definition at line 425 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ InitVariables()

private void InitVariables ( )

◆ 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 material will be changed to warn player.

Definition at line 293 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ IsPreviewOutOfRange()

bool IsPreviewOutOfRange ( out ENotification  outNotification = -1)

◆ IsPreviewVehicle()

bool IsPreviewVehicle ( IEntity  ent)

Check the given preview is vehicle.

Definition at line 215 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ OnPreviewCreated()

void OnPreviewCreated ( notnull SCR_EditablePreviewEntity  previewEnt)

Method called once the preview is spawned to initiate all the variables and start evaluate the obstruction.

Definition at line 100 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ 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 the preview into the world.)

Definition at line 133 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ SetSuperiorCanBeCreated()

void SetSuperiorCanBeCreated ( bool  val)

Set if the entity can be created, outside of the obstruction system. This is superior to internal m_bCanBeCreated.

Definition at line 126 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ TraceCylinder()

bool TraceCylinder ( vector  pos,
float  radius = 0.5,
float  height = 2,
TraceFlags  flags = TraceFlags.ENTS | TraceFlags.OCEAN,
BaseWorld  world = null 
)

Check for intersections within given cylinder. Performs 4 diagonal traces along cylinders circumference.

Parameters
posCylinder center position
radiusCylinder radius
heightCylinder full height
flagsTracing flags
worldWorld which is being traced
Returns
False if an intersection was found, true if the cylinder is devoid of obstacles

Definition at line 470 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ 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 at line 443 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

Variable Documentation

◆ BOUNDING_BOX_FACTOR

const protected float BOUNDING_BOX_FACTOR = 0.5

◆ BOUNDING_BOX_VEHICLE_FACTOR

const protected float BOUNDING_BOX_VEHICLE_FACTOR = 0.8

◆ HEIGHT_ABOVE_GROUND_BUFFER

const protected float HEIGHT_ABOVE_GROUND_BUFFER = 0.3

◆ HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER

const protected float HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER = 1

◆ m_bIsVehicle

protected bool m_bIsVehicle

◆ m_fCylinderHeight

protected float m_fCylinderHeight = 0.5

◆ m_fPitchMax

protected float m_fPitchMax

◆ m_fPitchMin

protected float m_fPitchMin

◆ m_fRollMax

protected float m_fRollMax

◆ m_fRollMin

protected float m_fRollMin

◆ m_fSafeZoneRadius

protected float m_fSafeZoneRadius = 0

◆ m_vCylinderVectorOffset

protected vector m_vCylinderVectorOffset = Vector(0, m_fCylinderHeight * 0.5, 0)

◆ m_vTraceOffset

protected vector m_vTraceOffset = Vector(0, 10, 0)

◆ MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE

const protected float MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE = 1

◆ MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT

const protected int MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT = 1

◆ MINIMAL_PROTECTION_RADIUS_TO_EVALUATE

const protected float MINIMAL_PROTECTION_RADIUS_TO_EVALUATE = 0.2

◆ PREVIEW_CHECK_FACTOR

const protected float PREVIEW_CHECK_FACTOR = 0.1

◆ SEA_LEVEL_OFFSET

const protected float SEA_LEVEL_OFFSET = 0.01