TerrainDeformCrater
- Parameters
x realThe x coordinate of the craters center.
y realThe y coordinate of the craters center.
radius realThe radius of the crater.
depth realThe depth of the crater.
duration integerThe duration in milliseconds.
permanent booleanMake the deformation permanent.
- comment
Create a crater at the given coordinates.
- note
To approximate the resulting height of a point
distanceunits away from the center point(x, y)you can use the following formula:Cos(bj_PI/2 * distance / radius) * -depth. See this issue for some more information.- note
Not every player might display those transformations due to graphics settings. Thus reading data like terrain height might lead to async values. See the other note on a way to compute an appropiate height to use instead.
- note
Permanent terrain deformations are not present in saved game files.
- patch
1.07
- Source
- common.j (suggest an edit or discuss on Github)
- return type
terraindeformation- Source code
native TerrainDeformCrater takes real x, real y, real radius, real depth, integer duration, boolean permanent returns terraindeformation