STerrain
Dans cette classeGetHeight
| Fonction | GetHeight | Get an interpolated height at a point x,y. |
| Fonction | GetSteepness | Get the gradient of the terrain at point (x,y). |
| Fonction | GetHeights | Returns a two dimensional array of heightmap samples. |
| Fonction | SetHeights | Sets heightmap data using a two dimensional array of heightmap samples. |
| Fonction | SetHeight | Set value to height of [x,y] |
| Fonction | GetNormal | Get an interpolated normal at a given location. |
| Fonction | GetSlope | Get a normalized and interpolated normal at a given location. |
| Fonction | GetContour | Get a contour of interpolated normal at a given location. |
| Propriété | Enabled | Is the Terrain component enabled? |
| Propriété | GameObject | The GameObject that this Terrain component is added to. |
Fonctions
GetHeight
Get an interpolated height at a point x,y.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | float | – |
| y | float | – |
Valeurs de retour
float
Exemple
floatHeight = Space.Host.ExecutingObject.Terrain.GetHeight(1,1)
GetSteepness
Get the gradient of the terrain at point (x,y).
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | float | – |
| y | float | – |
Valeurs de retour
float
Exemple
floatSteepness = Space.Host.ExecutingObject.Terrain.GetSteepness(1,1)
GetHeights
Returns a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The array has the dimensions [height,width] and is indexed as [y,x].
Valeurs de retour
float[,]
Exemple
tableHeights = Space.Host.ExecutingObject.Terrain.GetHeights()
SetHeights
Sets heightmap data using a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The heights array is indexed as [y,x].
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| data | float[,] | – |
Valeurs de retour
void
Exemple
tableHeights = Space.Host.ExecutingObject.Terrain.SetHeights({{1,2},{1,2}})
SetHeight
Set value to height of [x,y]
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | int | – |
| y | int | – |
| value | float | – |
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.Terrain.SetHeight(1,1,0.11)
GetNormal
Get an interpolated normal at a given location.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | float | – |
| y | float | – |
Valeurs de retour
SVector
Exemple
vectorNormal = Space.Host.ExecutingObject.Terrain.GetNormal(1,1)
GetSlope
Get a normalized and interpolated normal at a given location.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | float | – |
| y | float | – |
Valeurs de retour
SVector
Exemple
vectorSlope = Space.Host.ExecutingObject.Terrain.GetSlope(1,1)
GetContour
Get a contour of interpolated normal at a given location.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | float | – |
| y | float | – |
Valeurs de retour
SVector
Exemple
vectorContour = Space.Host.ExecutingObject.Terrain.GetContour(1,1)
Propriétés
Enabled
Is the Terrain component enabled?
Exemple
Space.Host.ExecutingObject.Terrain.Enabled = false
GameObjectLecture seule
The GameObject that this Terrain component is added to.
Exemple
theGameObject = Space.Host.ExecutingObject.Terrain.GameObject



