Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SCR_ObstacleDetector Interface Reference

Obstacle detector class used for example by SCR_GeneratorBaseEntity and ObjectBrushTool Refreshing Obstacles grabs all the possible obstacles HasObstacle checks depending on Avoid* settings Refreshing Obstacles -then- setting AvoidX is possible as first all obstacles are stored then used or not in the detection. More...

Public Member Functions

void SetAvoidObjects (bool avoidObjects)
 
void SetAvoidObjectsDetectionRadius (float radius)
 
void SetAvoidObjectsDetectionHeight (float height)
 
void SetAvoidRoads (bool avoidRoads)
 
void SetAvoidRivers (bool avoidRivers)
 
void SetAvoidPowerLines (bool avoidPowerLines)
 
void SetAvoidTracks (bool avoidTracks)
 
void SetAvoidForests (bool avoidForests)
 
void SetAvoidLakes (bool avoidLakes)
 
void SetAvoidLand (bool avoidLand)
 
void SetAvoidOcean (bool avoidOcean)
 
void SetAvoidLandOceanOffset (float offset)
 positive = above water, negative = below water
 
void RefreshObstaclesByAABB (vector worldMin, vector worldMax)
 
void RefreshObstaclesByWorld ()
 
void RefreshRoadObstaclesBySphere (vector worldPos, float radius)
 
void RefreshAreaObstaclesBySphere (vector worldPos, float radius)
 
void RefreshAreaObstaclesByWorld ()
 
bool HasObstacle (vector worldPos, array< IEntity > exclusionList=null)
 Detects obstacles based on current settings - a SCR_ObstacleDetector.RefreshObstaclesBy*() method must have been called earlier.
 
bool HasObstaclesList ()
 Check if calling HasObstacle is possible.
 
array< ref SCR_ObstacleDetectorSplineInfoGetObstacles ()
 Get all obstacle's SCR_ObstacleDetectorSplineInfo.
 
void ClearObstacles ()
 Empties obstacles information - a SCR_ObstacleDetector.RefreshObstaclesBy*() method must be called to use HasObstacle again.
 

Protected Member Functions

void SetupObstacleArrays (bool setupRoadSplines, bool setupAreaSplines)
 Sets up needed arrays.
 
bool BaseSplineQueryFilter (IEntity entity, bool getRoadSplines, bool getAreaSplines)
 Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage AllSplineQueryFilter, RoadSplineQueryFilter, AreaSplineQueryFilter call it.
 
bool AllSplineQueryFilter (IEntity entity)
 Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage.
 
bool RoadSplineQueryFilter (IEntity entity)
 Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage.
 
bool AreaSplineQueryFilter (IEntity entity)
 Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage.
 

Protected Attributes

bool m_bAvoidObjects
 
float m_fAvoidObjectsDetectionRadius
 
float m_fAvoidObjectsDetectionHeight
 
bool m_bAvoidRoads
 
bool m_bAvoidRivers
 
bool m_bAvoidPowerLines
 
bool m_bAvoidTracks
 
bool m_bAvoidForests
 
bool m_bAvoidLakes
 
bool m_bAvoidLand
 
bool m_bAvoidOcean
 
float m_fAvoidLandOceanOffset
 
ref array< ref SCR_ObstacleDetectorSplineInfom_aAvoidInfoRoads
 
ref array< ref SCR_ObstacleDetectorSplineInfom_aAvoidInfoRivers
 
ref array< ref SCR_ObstacleDetectorSplineInfom_aAvoidInfoPowerLines
 
ref array< ref SCR_ObstacleDetectorSplineInfom_aAvoidInfoTracks
 
ref array< ref SCR_ObstacleDetectorSplineInfom_aAvoidInfoLakes
 
ref array< ref SCR_ObstacleDetectorSplineInfom_aAvoidInfoForests
 
float m_fOceanLevel
 
ref TraceSphere m_AvoidObjectTraceSphere
 

Detailed Description

Obstacle detector class used for example by SCR_GeneratorBaseEntity and ObjectBrushTool Refreshing Obstacles grabs all the possible obstacles HasObstacle checks depending on Avoid* settings Refreshing Obstacles -then- setting AvoidX is possible as first all obstacles are stored then used or not in the detection.

Member Function Documentation

◆ AllSplineQueryFilter()

bool SCR_ObstacleDetector.AllSplineQueryFilter ( IEntity  entity)
protected

Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage.

◆ AreaSplineQueryFilter()

bool SCR_ObstacleDetector.AreaSplineQueryFilter ( IEntity  entity)
protected

Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage.

◆ BaseSplineQueryFilter()

bool SCR_ObstacleDetector.BaseSplineQueryFilter ( IEntity  entity,
bool  getRoadSplines,
bool  getAreaSplines 
)
protected

Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage AllSplineQueryFilter, RoadSplineQueryFilter, AreaSplineQueryFilter call it.

Parameters
getRoadSplinesget "road-like" splines - roads, rivers, powerlines
getAreaSplinesget area splines - lakes, forests
Returns
true when done

◆ ClearObstacles()

void SCR_ObstacleDetector.ClearObstacles ( )

Empties obstacles information - a SCR_ObstacleDetector.RefreshObstaclesBy*() method must be called to use HasObstacle again.

◆ GetObstacles()

array< ref SCR_ObstacleDetectorSplineInfo > SCR_ObstacleDetector.GetObstacles ( )

Get all obstacle's SCR_ObstacleDetectorSplineInfo.

Returns
null if obstacles are not initialised

◆ HasObstacle()

bool SCR_ObstacleDetector.HasObstacle ( vector  worldPos,
array< IEntity >  exclusionList = null 
)

Detects obstacles based on current settings - a SCR_ObstacleDetector.RefreshObstaclesBy*() method must have been called earlier.

Parameters
worldPosthe location to check - only the 2D position will be checked
exclusionListlist of entities that should not be considered as obstacles
Returns
true if an obstacle has been detected or on error, false otherwise

◆ HasObstaclesList()

bool SCR_ObstacleDetector.HasObstaclesList ( )

Check if calling HasObstacle is possible.

Returns
true if a search for obstacles (using Refresh.*Obstacles.* methods) has been called (after init or ClearObstacles call)

◆ RefreshAreaObstaclesBySphere()

void SCR_ObstacleDetector.RefreshAreaObstaclesBySphere ( vector  worldPos,
float  radius 
)

◆ RefreshAreaObstaclesByWorld()

void SCR_ObstacleDetector.RefreshAreaObstaclesByWorld ( )

◆ RefreshObstaclesByAABB()

void SCR_ObstacleDetector.RefreshObstaclesByAABB ( vector  worldMin,
vector  worldMax 
)

◆ RefreshObstaclesByWorld()

void SCR_ObstacleDetector.RefreshObstaclesByWorld ( )

◆ RefreshRoadObstaclesBySphere()

void SCR_ObstacleDetector.RefreshRoadObstaclesBySphere ( vector  worldPos,
float  radius 
)

◆ RoadSplineQueryFilter()

bool SCR_ObstacleDetector.RoadSplineQueryFilter ( IEntity  entity)
protected

Fills m_aAvoidInfo* arrays from RefreshObstaclesBy* request for HasObstacle usage.

◆ SetAvoidForests()

void SCR_ObstacleDetector.SetAvoidForests ( bool  avoidForests)

◆ SetAvoidLakes()

void SCR_ObstacleDetector.SetAvoidLakes ( bool  avoidLakes)

◆ SetAvoidLand()

void SCR_ObstacleDetector.SetAvoidLand ( bool  avoidLand)

◆ SetAvoidLandOceanOffset()

void SCR_ObstacleDetector.SetAvoidLandOceanOffset ( float  offset)

positive = above water, negative = below water

Parameters
offsetvalue in metres

◆ SetAvoidObjects()

void SCR_ObstacleDetector.SetAvoidObjects ( bool  avoidObjects)

◆ SetAvoidObjectsDetectionHeight()

void SCR_ObstacleDetector.SetAvoidObjectsDetectionHeight ( float  height)

◆ SetAvoidObjectsDetectionRadius()

void SCR_ObstacleDetector.SetAvoidObjectsDetectionRadius ( float  radius)
Parameters
radiusaccepts 0..inf radius - a negative value will be floored to zero

◆ SetAvoidOcean()

void SCR_ObstacleDetector.SetAvoidOcean ( bool  avoidOcean)

◆ SetAvoidPowerLines()

void SCR_ObstacleDetector.SetAvoidPowerLines ( bool  avoidPowerLines)

◆ SetAvoidRivers()

void SCR_ObstacleDetector.SetAvoidRivers ( bool  avoidRivers)

◆ SetAvoidRoads()

void SCR_ObstacleDetector.SetAvoidRoads ( bool  avoidRoads)

◆ SetAvoidTracks()

void SCR_ObstacleDetector.SetAvoidTracks ( bool  avoidTracks)

◆ SetupObstacleArrays()

void SCR_ObstacleDetector.SetupObstacleArrays ( bool  setupRoadSplines,
bool  setupAreaSplines 
)
protected

Sets up needed arrays.

Parameters
setupRoadSplinesinstanciates "road" spline arrays
setupAreaSplinesinstanciates area spline arrays

Member Data Documentation

◆ m_aAvoidInfoForests

ref array<ref SCR_ObstacleDetectorSplineInfo> SCR_ObstacleDetector.m_aAvoidInfoForests
protected

◆ m_aAvoidInfoLakes

ref array<ref SCR_ObstacleDetectorSplineInfo> SCR_ObstacleDetector.m_aAvoidInfoLakes
protected

◆ m_aAvoidInfoPowerLines

ref array<ref SCR_ObstacleDetectorSplineInfo> SCR_ObstacleDetector.m_aAvoidInfoPowerLines
protected

◆ m_aAvoidInfoRivers

ref array<ref SCR_ObstacleDetectorSplineInfo> SCR_ObstacleDetector.m_aAvoidInfoRivers
protected

◆ m_aAvoidInfoRoads

ref array<ref SCR_ObstacleDetectorSplineInfo> SCR_ObstacleDetector.m_aAvoidInfoRoads
protected

◆ m_aAvoidInfoTracks

ref array<ref SCR_ObstacleDetectorSplineInfo> SCR_ObstacleDetector.m_aAvoidInfoTracks
protected

◆ m_AvoidObjectTraceSphere

ref TraceSphere SCR_ObstacleDetector.m_AvoidObjectTraceSphere
protected

◆ m_bAvoidForests

bool SCR_ObstacleDetector.m_bAvoidForests
protected

◆ m_bAvoidLakes

bool SCR_ObstacleDetector.m_bAvoidLakes
protected

◆ m_bAvoidLand

bool SCR_ObstacleDetector.m_bAvoidLand
protected

◆ m_bAvoidObjects

bool SCR_ObstacleDetector.m_bAvoidObjects
protected

◆ m_bAvoidOcean

bool SCR_ObstacleDetector.m_bAvoidOcean
protected

◆ m_bAvoidPowerLines

bool SCR_ObstacleDetector.m_bAvoidPowerLines
protected

◆ m_bAvoidRivers

bool SCR_ObstacleDetector.m_bAvoidRivers
protected

◆ m_bAvoidRoads

bool SCR_ObstacleDetector.m_bAvoidRoads
protected

◆ m_bAvoidTracks

bool SCR_ObstacleDetector.m_bAvoidTracks
protected

◆ m_fAvoidLandOceanOffset

float SCR_ObstacleDetector.m_fAvoidLandOceanOffset
protected

◆ m_fAvoidObjectsDetectionHeight

float SCR_ObstacleDetector.m_fAvoidObjectsDetectionHeight
protected

◆ m_fAvoidObjectsDetectionRadius

float SCR_ObstacleDetector.m_fAvoidObjectsDetectionRadius
protected

◆ m_fOceanLevel

float SCR_ObstacleDetector.m_fOceanLevel
protected

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