getTerrainInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 8: Line 8:
|gr1= Diagnostic
|gr1= Diagnostic


|descr= {{Wiki|WIP}}
|descr= Returns the terrain heightmap information, as well as sea level offset (due to tides, if available).


|s1= [[getTerrainInfo]]
|s1= [[getTerrainInfo]]


|r1= [[Array]] -  
|r1= [[Array]] - In format {{hl|[landGridWidth, landGridSize, terrainGridWidth, terrainGridSize, seaLevel]}}:
* landGridWidth: [[Number]] - width of each land grid
* landGridSize: [[Number]] - number of land grid pixels
* terrainGridWidth: [[Number]] width of each terrain grid (also known as "cell size")
* terrainGridSize: [[Number]] - number of terrain grid pixels (also known as "heightmap resolution")
* seaLevel: [[Number]] - sea level without waves. The value is {{hl|0}} if tides are disabled.


|x1= <sqf>private _terrainInfo = getTerrainInfo;</sqf>
{{Feature|Informative|
* The result of {{hl|landGridWidth * landGridSize}} and {{hl|terrainGridWidth * terrainGridSize}} is always equal to the [[worldSize]].
* "land grid" is used by the game for object placement (e.g. finding the [[nearestObject]]), dynamic simulation, etc.
* "terrain grid" is used for showing the terrain, measuring surface normal, etc. }}
}}
 
|x1= <sqf>private _terrainInfo = getTerrainInfo; // Stratis: [32,256,4,2048,0]; Altis: [30,1024,7.5,4096,0] </sqf>


|seealso= [[getTerrainHeight]] [[setTerrainHeight]]
|seealso= [[getTerrainHeight]] [[setTerrainHeight]]
}}
}}

Revision as of 16:17, 22 June 2022

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.10.

Description

Description:
Returns the terrain heightmap information, as well as sea level offset (due to tides, if available).
Groups:
Diagnostic

Syntax

Syntax:
getTerrainInfo
Return Value:
Array - In format [landGridWidth, landGridSize, terrainGridWidth, terrainGridSize, seaLevel]:
  • landGridWidth: Number - width of each land grid
  • landGridSize: Number - number of land grid pixels
  • terrainGridWidth: Number width of each terrain grid (also known as "cell size")
  • terrainGridSize: Number - number of terrain grid pixels (also known as "heightmap resolution")
  • seaLevel: Number - sea level without waves. The value is 0 if tides are disabled.
  • The result of landGridWidth * landGridSize and terrainGridWidth * terrainGridSize is always equal to the worldSize.
  • "land grid" is used by the game for object placement (e.g. finding the nearestObject), dynamic simulation, etc.
  • "terrain grid" is used for showing the terrain, measuring surface normal, etc.

Examples

Examples:
Example needed

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

|x1=

private _terrainInfo = getTerrainInfo; // Stratis: [32,256,4,2048,0]; Altis: [30,1024,7.5,4096,0]

|seealso= getTerrainHeight setTerrainHeight }}