Arma Reforger Script API
|
Static Public Member Functions | |
static bool | TryFindNearbyFloorPositionForEntity (BaseWorld world, IEntity entity, vector position=vector.Zero, out vector floorPos=vector.Zero) |
Finds nearby floor position with enough space for the entity, considering its amphibious trait if applicable. | |
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") |
Attempts to find a nearby position with suitable space defined by traceParam. | |
static bool | TryGetValidFloorPosition (BaseWorld world, vector position, float minHeight, TraceParam traceParam, float minFloorY, float bonusTraceLength, out vector floorPos, out vector ceilingPos) |
Checks if there's a floor with enough empty space above it. | |
static bool | TryDetectSurface (BaseWorld world, TraceParam traceParam, out vector surfacePos) |
Detects surface position along trace path in world, returns true if surface was found. | |
static bool | TryGetValidFloorPositionWithPreTrace (BaseWorld world, vector position, float minHeight, TraceParam traceParam, float minFloorY, TraceParam preTraceParam, out vector floorPos, out vector ceilingPos) |
Wraps TryGetValidFloorPosition Adds a pre-trace to allow better room finding in cluttered spaces like interiors and offices. | |
static float | GetTraceParamHeight (TraceParam traceParam) |
Calculates height from trace parameter supports derivatives of TraceBox or TraceSphere. | |
static vector | RaiseToTerrain (BaseWorld world, vector position, float offset=0) |
Raises position to be above ocean height with optional offset. | |
static float | GetMinYOnTerrainOrOcean (BaseWorld world, vector position, float maxSubmersionDepth) |
Returns minimum height allowed for a valid floor over terrain or ocean considering max submersion depth. | |
static TraceSphere | CreatePreTraceParam (TraceParam traceParam) |
Clones properties from TraceParam to create a TraceSphere with small radius. | |
Static Public Attributes | |
static const float | MAX_SCAN_LENGTH = 50 |
static const int | SPHERE_AMOUNT_LIMIT = 3 |
static const float | TRACE_EPSILON = 0.01 |
static const float | CHARACTER_BOUNDING_RADIUS_MODIFIER = 0.75 |
static const float | CHARACTER_SPACING_MODIFIER = 0.5 |
Static Protected Member Functions | |
static SCR_EditableEntityUIInfo | GetEntityUIInfo (IEntity entity) |
Tries to get SCR_EditableEntityUIInfo from entity. | |
static float | Pow2 (float base) |
Squares a value. | |
Static Protected Attributes | |
static const string | DEBUG_TAG = "SCR_EmptyPositionHelper" |
|
static |
Clones properties from TraceParam to create a TraceSphere with small radius.
Pre-traces allow better room finding in cluttered spaces like interiors and offices.
[in] | traceParam | TraceParam represents input parameters for sphere tracing, including flags, layer mask, radii, exclusions, and inclusions. |
|
staticprotected |
Tries to get SCR_EditableEntityUIInfo from entity.
[in] | entity | Represents an in-game object with editable properties. |
|
static |
Returns minimum height allowed for a valid floor over terrain or ocean considering max submersion depth.
[in] | world | Game world. |
[in] | maxSubmersionDepth | MaxSubmersionDepth represents the maximum depth at which the object can submerge in water. |
|
static |
Calculates height from trace parameter supports derivatives of TraceBox or TraceSphere.
[in] | traceParam | TraceParam to determine height of. |
|
staticprotected |
Squares a value.
[in] | Value |
|
static |
Raises position to be above ocean height with optional offset.
Will not do anything if the position is already above the ocean + offset.
[in] | world | Game world. |
[in] | position | Position checked if bellow ocean and raised if it is. |
[in] | offset | Offset is an optional parameter that adds to the position's height above ocean level. |
|
static |
Detects surface position along trace path in world, returns true if surface was found.
[in] | world | Game world. |
[in] | traceParam | TraceParam needs to have everythging nessary defined. |
[out] | surfacePos | Surface position of center of trace in 3D space where the trace intersects a surface. |
|
static |
Attempts to find a nearby position with suitable space defined by traceParam.
[in] | world | Game world. |
[in] | position | The start position for searching. |
[in,out] | traceParam | TraceParam must define a shape with dimensions. |
[in] | minHeight | Minimum scan length is the minimum distance that the shape must be traced. |
[in] | spacing | Spacing represents the distance between checks, this should be atleast or greater than the size of the entity. |
[in] | maxDistance | MaxDistance is the maximum distance from the start position to search for a valid floor positions. |
[in] | isAmphibious | Amphibious switch indicates whether the search for floor position should consider ocean surface as a valid floor. |
[out] | floorPos | Represents the final found floor position within the specified search area. |
|
static |
Finds nearby floor position with enough space for the entity, considering its amphibious trait if applicable.
Does not move or modify the entity.
[in] | world | Game world. |
[in] | entity | Entity is used to define Trace params, amphibious trait, and position*. |
[in] | position | Optional position to use for searching from instead of entity.GetOrigin(). |
[out] | floorPos | If successful it is the floor with enough space for the entity can stand. |
|
static |
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
[in] | world | Game world. |
[in] | position | Position to start search from. |
[in] | minHeight | MinHeight is the minimium length that the shape needs to be trace out to fit the height requirement for empty space above the floor. |
[in] | traceParam | TraceParam should specify flags, entities, shape, and size to trace. Start and end position are overwritten on reference. |
[in] | If | the scanned floor position is lower than this, the function will return false. |
[in] | Extra | ceiling height to scan for if knowing the ceiling is desired. |
[out] | floorPos | Represents the position of the floor detected by tracing downwards from the input position. |
[out] | ceilingPos | Ceiling position represents the ceiling detected by tracing upwards. Limited to floor + minHeight. |
|
static |
Wraps TryGetValidFloorPosition Adds a pre-trace to allow better room finding in cluttered spaces like interiors and offices.
[in] | world | Game world. |
[in] | position | Position to start search from. |
[in] | minHeight | MinHeight is the minimium length that the shape needs to be trace out to fit the height requirement for empty space above the floor. |
[in] | traceParam | TraceParam should specify flags, entities, shape, and size to trace. Start and end position are overwritten on reference. |
[out] | If | the scanned floor position is lower than this, the function will return false. |
[out] | floorPos | Represents the position of the floor detected by tracing downwards from the input position. |
[out] | ceilingPos | Ceiling position represents the ceiling detected by tracing upwards. Limited to floor + minHeight. |
|
static |
|
static |
|
staticprotected |
|
static |
|
static |
|
static |