Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBuildingPlacingObstructionEditorComponent.c File Reference

Go to the source code of this file.

Classes

class  SCR_CampaignBuildingPlacingObstructionEditorComponentClass

Functions

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

Variables

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

Function Documentation

◆ CanBeCreated()

bool CanBeCreated ( )
protected

Return current canbeCreated value.

Definition at line 120 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ CanCreate()

bool CanCreate ( out ENotification outNotification = -1,
out SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE )
protected

Check the preview position. Is suitable to build the composition here?

Definition at line 300 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ CheckEntityPosition()

bool CheckEntityPosition ( vector pos,
float safeZoneRadius )
protected

Check entity position in given radius.

Definition at line 403 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ CheckVehiclePosition()

bool CheckVehiclePosition ( )
protected

Check entity position in given bounding box.

Definition at line 436 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ EOnEditorActivate()

void EOnEditorActivate ( )
protected

◆ EOnEditorActivateServer()

void EOnEditorActivateServer ( )
protected

◆ EOnEditorClose()

void EOnEditorClose ( )
protected

◆ EOnEditorOpen()

void EOnEditorOpen ( )
protected

◆ EOnEditorOpenServer()

void EOnEditorOpenServer ( )
protected

◆ EvaluateBlockingEntity()

bool EvaluateBlockingEntity ( IEntity ent)
protected

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 483 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ GetAllEntitiesToEvaluate()

void GetAllEntitiesToEvaluate ( notnull SCR_EditablePreviewEntity rootEnt)
protected

◆ GetEntityProtectionRadius()

float GetEntityProtectionRadius ( notnull IEntity ent)
protected

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

Definition at line 356 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ GetPredefineProtectionRadius()

float GetPredefineProtectionRadius ( ResourceName resName)
protected

◆ HasObstructionException()

bool HasObstructionException ( notnull IEntity ent)
protected

Check if detected entity has set any obstruction exception rulles.

Definition at line 506 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ IsCompositionTilted()

bool IsCompositionTilted ( notnull IEntity ent,
float entityRadius,
vector originalTransformAngles,
out SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE )
protected

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 365 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ IsPreviewVehicle()

bool IsPreviewVehicle ( IEntity ent)
protected

Check the given preview is vehicle.

Definition at line 287 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ OnPreviewCreated()

void OnPreviewCreated ( notnull SCR_EditablePreviewEntity previewEnt)
protected

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

Definition at line 101 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ SetInitialCanBeCreatedState()

void SetInitialCanBeCreatedState ( notnull SCR_EditablePreviewEntity previewEnt)
protected

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 134 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ SetSuperiorCanBeCreated()

void SetSuperiorCanBeCreated ( bool val)
protected

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

Definition at line 127 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 )
protected

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 551 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

◆ TraceEntityOnPosition()

bool TraceEntityOnPosition ( vector position,
notnull BaseWorld world,
float safeZoneRadius )
protected

Trace at the position of the preview to find any possibly cliping entities.

Definition at line 524 of file SCR_CampaignBuildingPlacingObstructionEditorComponent.c.

Variable Documentation

◆ BOUNDING_BOX_FACTOR

const float BOUNDING_BOX_FACTOR = 0.5
protected

◆ BOUNDING_BOX_VEHICLE_FACTOR

const float BOUNDING_BOX_VEHICLE_FACTOR = 0.8
protected

◆ HEIGHT_ABOVE_GROUND_BUFFER

const float HEIGHT_ABOVE_GROUND_BUFFER = 0.3
protected

◆ HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER

const float HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER = 0.5
protected

◆ m_bIsVehicle

bool m_bIsVehicle
protected

◆ m_fCylinderHeight

float m_fCylinderHeight = 0.5
protected

◆ m_fPitchMax

float m_fPitchMax
protected

◆ m_fPitchMin

float m_fPitchMin
protected

◆ m_fRollMax

float m_fRollMax
protected

◆ m_fRollMin

float m_fRollMin
protected

◆ m_fSafeZoneRadius

float m_fSafeZoneRadius = 0
protected

◆ m_vCylinderVectorOffset

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

◆ m_vTraceOffset

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

◆ MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE

const float MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE = 1
protected

◆ MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT

const int MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT = 1
protected

◆ MINIMAL_PROTECTION_RADIUS_TO_EVALUATE

const float MINIMAL_PROTECTION_RADIUS_TO_EVALUATE = 0.2
protected

◆ PREVIEW_CHECK_FACTOR

const float PREVIEW_CHECK_FACTOR = 0.1
protected

◆ SEA_LEVEL_OFFSET

const float SEA_LEVEL_OFFSET = 0.01
protected

◆ Y_BUFFER

const float Y_BUFFER = 0.3
protected