All pages
Powered by GitBook
1 of 1

Loading...

STerrain

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

GetHeight

float GetHeight (float x, float y)

Get an interpolated height at a point x,y.

Parameter
Type
Description

GetSteepness

float GetSteepness (float x, float y)

Get the gradient of the terrain at point (x,y).

Parameter
Type
Description

GetHeights

float[,] 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].

SetHeights

void SetHeights (float[,] data)

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].

Parameter
Type
Description

SetHeight

void SetHeight (int x, int y, float value)

Set value to height of [x,y]

Parameter
Type
Description

GetNormal

GetNormal (float x, float y)

Get an interpolated normal at a given location.

Parameter
Type
Description

GetSlope

GetSlope (float x, float y)

Get a normalized and interpolated normal at a given location.

Parameter
Type
Description

GetContour

GetContour (float x, float y)

Get a contour of interpolated normal at a given location.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Is the Terrain component enabled?

GameObject

GameObject get

The GameObject that this Terrain component is added to.

float GetHeight (float x, float y)

float GetSteepness (float x, float y)

float[,] GetHeights ()

void SetHeights (float[,] data)

void SetHeight (int x, int y, float value)

SVector GetNormal (float x, float y)

SVector GetSlope (float x, float y)

SVector GetContour (float x, float y)

bool Enabled get set

SGameObject GameObject get

SVector
SVector
SVector
SGameObject
floatHeight = Space.Host.ExecutingObject.Terrain.GetHeight(1,1)
floatSteepness = Space.Host.ExecutingObject.Terrain.GetSteepness(1,1)
tableHeights = Space.Host.ExecutingObject.Terrain.GetHeights()
tableHeights = Space.Host.ExecutingObject.Terrain.SetHeights({{1,2},{1,2}})
Space.Host.ExecutingObject.Terrain.SetHeight(1,1,0.11) 
vectorNormal = Space.Host.ExecutingObject.Terrain.GetNormal(1,1)
vectorSlope = Space.Host.ExecutingObject.Terrain.GetSlope(1,1)
vectorContour = Space.Host.ExecutingObject.Terrain.GetContour(1,1)
Space.Host.ExecutingObject.Terrain.Enabled = false
theGameObject = Space.Host.ExecutingObject.Terrain.GameObject