Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_EmptyPositionHelper Class Reference

Static Protected Member Functions

static bool TryFindNearbyFloorPositionForEntity (BaseWorld world, IEntity entity, vector position=vector.Zero, out vector floorPos=vector.Zero)
static bool TryFindNearbyFloorPosition (BaseWorld world, vector position, TraceParam traceParam, float minHeight, float spacing, float maxDistance=100, bool isAmphibious=false, float maxSubmersionDepth=0, out vector floorPos="0 0 0")
static bool TryGetValidFloorPosition (BaseWorld world, vector position, float minHeight, TraceParam traceParam, float minFloorY, float bonusTraceLength, out vector floorPos, out vector ceilingPos)
static bool TryDetectSurface (BaseWorld world, TraceParam traceParam, out vector surfacePos)
static bool TryGetValidFloorPositionWithPreTrace (BaseWorld world, vector position, float minHeight, TraceParam traceParam, float minFloorY, TraceParam preTraceParam, out vector floorPos, out vector ceilingPos)
static SCR_EditableEntityUIInfo GetEntityUIInfo (IEntity entity)
static float GetTraceParamHeight (TraceParam traceParam)
static vector RaiseToTerrain (BaseWorld world, vector position, float offset=0)
static float GetMinYOnTerrainOrOcean (BaseWorld world, vector position, float maxSubmersionDepth)
static float Pow2 (float base)
static TraceSphere CreatePreTraceParam (TraceParam traceParam)

Static Protected Attributes

static const string DEBUG_TAG = "SCR_EmptyPositionHelper"

Detailed Description

Definition at line 3 of file SCR_EmptyPositionHelper.c.

Member Function Documentation

◆ CreatePreTraceParam()

TraceSphere SCR_EmptyPositionHelper::CreatePreTraceParam ( TraceParam traceParam)
inlinestaticprotected

Clones properties from TraceParam to create a TraceSphere with small radius. Pre-traces allow better room finding in cluttered spaces like interiors and offices.

Parameters
[in]traceParamTraceParam represents input parameters for sphere tracing, including flags, layer mask, radii, exclusions, and inclusions.
Returns
a pre-trace parameter with adjusted radius and same flags, layer mask, exclusions, inclusions, and arrays as

Definition at line 344 of file SCR_EmptyPositionHelper.c.

◆ GetEntityUIInfo()

SCR_EditableEntityUIInfo SCR_EmptyPositionHelper::GetEntityUIInfo ( IEntity entity)
inlinestaticprotected

Tries to get SCR_EditableEntityUIInfo from entity.

Parameters
[in]entityRepresents an in-game object with editable properties.
Returns
the SCR_EditableEntityUIInfo associated with the entity.

Definition at line 279 of file SCR_EmptyPositionHelper.c.

◆ GetMinYOnTerrainOrOcean()

float SCR_EmptyPositionHelper::GetMinYOnTerrainOrOcean ( BaseWorld world,
vector position,
float maxSubmersionDepth )
inlinestaticprotected

Returns minimum height allowed for a valid floor over terrain or ocean considering max submersion depth.

Parameters
[in]worldGame world.
[in]maxSubmersionDepthMaxSubmersionDepth represents the maximum depth at which the object can submerge in water.
Returns
the minimum height of a valid floor.

Definition at line 323 of file SCR_EmptyPositionHelper.c.

◆ GetTraceParamHeight()

float SCR_EmptyPositionHelper::GetTraceParamHeight ( TraceParam traceParam)
inlinestaticprotected

Calculates height from trace parameter supports derivatives of TraceBox or TraceSphere.

Parameters
[in]traceParamTraceParam to determine height of.
Returns
height of trace.

Definition at line 291 of file SCR_EmptyPositionHelper.c.

◆ Pow2()

float SCR_EmptyPositionHelper::Pow2 ( float base)
inlinestaticprotected

Squares a value.

Parameters
[in]Value
Returns
square

Definition at line 334 of file SCR_EmptyPositionHelper.c.

◆ RaiseToTerrain()

vector SCR_EmptyPositionHelper::RaiseToTerrain ( BaseWorld world,
vector position,
float offset = 0 )
inlinestaticprotected

Raises position to be above ocean height with optional offset. Will not do anything if the position is already above the ocean + offset.

Parameters
[in]worldGame world.
[in]positionPosition checked if bellow ocean and raised if it is.
[in]offsetOffset is an optional parameter that adds to the position's height above ocean level.
Returns
the modified position with height adjusted to ocean level plus offset.

Definition at line 311 of file SCR_EmptyPositionHelper.c.

◆ TryDetectSurface()

bool SCR_EmptyPositionHelper::TryDetectSurface ( BaseWorld world,
TraceParam traceParam,
out vector surfacePos )
inlinestaticprotected

Detects surface position along trace path in world, returns true if surface was found.

Parameters
[in]worldGame world.
[in]traceParamTraceParam needs to have everythging nessary defined.
[out]surfacePosSurface position of center of trace in 3D space where the trace intersects a surface.
Returns
True if a surface was detected.

Definition at line 247 of file SCR_EmptyPositionHelper.c.

◆ TryFindNearbyFloorPosition()

bool SCR_EmptyPositionHelper::TryFindNearbyFloorPosition ( BaseWorld world,
vector position,
TraceParam traceParam,
float minHeight,
float spacing,
float maxDistance = 100,
bool isAmphibious = false,
float maxSubmersionDepth = 0,
out vector floorPos = "0 0 0" )
inlinestaticprotected

Attempts to find a nearby position with suitable space defined by traceParam.

Parameters
[in]worldGame world.
[in]positionThe start position for searching.
[in,out]traceParamTraceParam must define a shape with dimensions.
[in]minHeightMinimum scan length is the minimum distance that the shape must be traced.
[in]spacingSpacing represents the distance between checks, this should be atleast or greater than the size of the entity.
[in]maxDistanceMaxDistance is the maximum distance from the start position to search for a valid floor positions.
[in]isAmphibiousAmphibious switch indicates whether the search for floor position should consider ocean surface as a valid floor.
[out]floorPosRepresents the final found floor position within the specified search area.
Returns
True if a valid floor was found.

Definition at line 74 of file SCR_EmptyPositionHelper.c.

◆ TryFindNearbyFloorPositionForEntity()

bool SCR_EmptyPositionHelper::TryFindNearbyFloorPositionForEntity ( BaseWorld world,
IEntity entity,
vector position = vector.Zero,
out vector floorPos = vector.Zero )
inlinestaticprotected

Finds nearby floor position with enough space for the entity, considering its amphibious trait if applicable. Does not move or modify the entity.

Parameters
[in]worldGame world.
[in]entityEntity is used to define Trace params, amphibious trait, and position*.
[in]positionOptional position to use for searching from instead of entity.GetOrigin().
[out]floorPosIf successful it is the floor with enough space for the entity can stand.
Returns
True if a floor with enough space was found.

Definition at line 20 of file SCR_EmptyPositionHelper.c.

◆ TryGetValidFloorPosition()

bool SCR_EmptyPositionHelper::TryGetValidFloorPosition ( BaseWorld world,
vector position,
float minHeight,
TraceParam traceParam,
float minFloorY,
float bonusTraceLength,
out vector floorPos,
out vector ceilingPos )
inlinestaticprotected

Checks if there's a floor with enough empty space above it. Ocean surface counts as a floor. Does not scan further than MAX_SCAN_LENGTH

Parameters
[in]worldGame world.
[in]positionPosition to start search from.
[in]minHeightMinHeight is the minimium length that the shape needs to be trace out to fit the height requirement for empty space above the floor.
[in]traceParamTraceParam should specify flags, entities, shape, and size to trace. Start and end position are overwritten on reference.
[in]Ifthe scanned floor position is lower than this, the function will return false.
[in]Extraceiling height to scan for if knowing the ceiling is desired.
[out]floorPosRepresents the position of the floor detected by tracing downwards from the input position.
[out]ceilingPosCeiling position represents the ceiling detected by tracing upwards. Limited to floor + minHeight.
Returns
True if a floor with enough empty space was found.

Definition at line 157 of file SCR_EmptyPositionHelper.c.

◆ TryGetValidFloorPositionWithPreTrace()

bool SCR_EmptyPositionHelper::TryGetValidFloorPositionWithPreTrace ( BaseWorld world,
vector position,
float minHeight,
TraceParam traceParam,
float minFloorY,
TraceParam preTraceParam,
out vector floorPos,
out vector ceilingPos )
inlinestaticprotected

Wraps TryGetValidFloorPosition Adds a pre-trace to allow better room finding in cluttered spaces like interiors and offices.

Parameters
[in]worldGame world.
[in]positionPosition to start search from.
[in]minHeightMinHeight is the minimium length that the shape needs to be trace out to fit the height requirement for empty space above the floor.
[in]traceParamTraceParam should specify flags, entities, shape, and size to trace. Start and end position are overwritten on reference.
[out]Ifthe scanned floor position is lower than this, the function will return false.
[out]floorPosRepresents the position of the floor detected by tracing downwards from the input position.
[out]ceilingPosCeiling position represents the ceiling detected by tracing upwards. Limited to floor + minHeight.
Returns
True if a floor with enough empty space was found.

Definition at line 265 of file SCR_EmptyPositionHelper.c.

Member Data Documentation

◆ DEBUG_TAG

const string SCR_EmptyPositionHelper::DEBUG_TAG = "SCR_EmptyPositionHelper"
staticprotected

Definition at line 10 of file SCR_EmptyPositionHelper.c.


The documentation for this class was generated from the following file: