er2.getDistanceFromTerrain 2
Returns the distance between the given position and the terrain.
Return value
Return Type | Description |
---|---|
float | Important: if the given position is under the terrain, will return a negative distance |
Parameters
Parameter | Type | Description |
---|---|---|
1 | vec3 | The starting position |
2 | bool | (Optional) Used for positions over water. If true, if water is present, returns the distance between the starting point and the surface of the water, or else the bottom of the sea. Default is false |
Examples
No examples available.