Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_TerrainHelper Interface Reference

Static Public Member Functions

static float GetTerrainY (vector pos, BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Get terrain height at given position.
 
static float GetHeightAboveTerrain (vector pos, BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Get height above terrain of given position.
 
static vector GetTerrainNormal (inout vector pos, BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Get terrain normal vector on given position.
 
static bool GetTerrainBasis (vector pos, out vector result[4], BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Get terrain basis vectors on given position.
 
static void SnapToGeometry (out vector newPosition, vector currentPosition, array< IEntity > excludedEntities, BaseWorld world=null, TraceParam traceParam=null, out vector surfaceNormal=vector.Zero)
 Snap transformation to nearest geometry beneath provided position.
 
static bool SnapToTerrain (out vector transform[4], BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Snap transformation to terrain position.
 
static bool OrientToTerrain (out vector transform[4], BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Orient transformation to terrain normal.
 
static bool SnapAndOrientToTerrain (out vector transform[4], BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
 Snap transformation to terrain position and orient it to terrain normal.
 

Static Protected Attributes

static const float MAX_TRACE_LENGTH = 100
 

Member Function Documentation

◆ GetHeightAboveTerrain()

static float SCR_TerrainHelper.GetHeightAboveTerrain ( vector pos,
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Get height above terrain of given position.

Parameters
[in]posWorld position
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
altitude above terrain

◆ GetTerrainBasis()

static bool SCR_TerrainHelper.GetTerrainBasis ( vector pos,
out vector result[4],
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Get terrain basis vectors on given position.

Parameters
[in]posWorld position
[out]resultMatrix to be filled with basis vectors
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
True if the basis was defined successfully

◆ GetTerrainNormal()

static vector SCR_TerrainHelper.GetTerrainNormal ( inout vector pos,
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Get terrain normal vector on given position.

Parameters
[in,out]posWorld position, its vertical axis will be modified to be the surface height
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
Normal vector

◆ GetTerrainY()

static float SCR_TerrainHelper.GetTerrainY ( vector pos,
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Get terrain height at given position.

Parameters
[in]posWorld position
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
altitude above sea

◆ OrientToTerrain()

static bool SCR_TerrainHelper.OrientToTerrain ( out vector transform[4],
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Orient transformation to terrain normal.

Parameters
[out]transformMatrix to be modified
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
True if the operation was performed successfully

◆ SnapAndOrientToTerrain()

static bool SCR_TerrainHelper.SnapAndOrientToTerrain ( out vector transform[4],
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Snap transformation to terrain position and orient it to terrain normal.

Parameters
[out]transformMatrix to be modified
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
True if the operation was performed successfully

◆ SnapToGeometry()

static void SCR_TerrainHelper.SnapToGeometry ( out vector newPosition,
vector currentPosition,
array< IEntity > excludedEntities,
BaseWorld world = null,
TraceParam traceParam = null,
out vector surfaceNormal = vector::Zero )
static

Snap transformation to nearest geometry beneath provided position.

Parameters
[out]newPositionthat is snapped to the geometry
[in]currentPositionthat will be used as a starting point for snapping
[in]excludedEntitiesarray that will not be taken into account when snapping to the geometry
[in]worldWorld to be checked (default world is used when undefined)
[in]traceParamWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
[out]surfaceNormalReturns the surface intersection normal

◆ SnapToTerrain()

static bool SCR_TerrainHelper.SnapToTerrain ( out vector transform[4],
BaseWorld world = null,
bool noUnderwater = false,
TraceParam trace = null )
static

Snap transformation to terrain position.

Parameters
[out]transformMatrix to be modified
[in]worldWorld to be checked (default world is used when undefined)
[in]noUnderwaterWhen true, sea surface will be used instead of seabed
[in]traceWhen defined, use this trace to check surface intersection (useful for setting custom trace flags or ignored entities)
Returns
True if the operation was performed successfully

Member Data Documentation

◆ MAX_TRACE_LENGTH

const float SCR_TerrainHelper.MAX_TRACE_LENGTH = 100
staticprotected

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