Terrain
Classes:
A strip shaped decal defined by spine nodes which clips against Terrain objects.
An infinite plane extending in all direction.
A strip of rectangular mesh segments defined by a 3D spline for prototyping road-shaped objects in your scene.
Represent a terrain object in a Torque 3D level.
Variables
bool
Triggers debug rendering of terrain cells.
float
A global detail scale used to tweak the material detail distances.
float
A global LOD scale used to tweak the default terrain screen error value.
Functions
bool
getTerrainHeight(F32 x, F32 y)
Gets the terrain height at the specified position.
bool
getTerrainHeight(Point2I position)
Gets the terrain height at the specified position.
bool
getTerrainHeightBelowPosition(F32 x, F32 y)
Takes a world point and find the "highest" terrain underneath it.
bool
getTerrainHeightBelowPosition(Point2I position)
Takes a world point and find the "highest" terrain underneath it.
bool
getTerrainUnderWorldPoint(F32 x, F32 y, F32 z)
Takes a world point and find the "highest" terrain underneath it.
bool
getTerrainUnderWorldPoint(Point3F position)
Gets the terrain block that is located under the given world point.
Detailed Description
Variables
bool debugRender
Triggers debug rendering of terrain cells.
float detailScale
A global detail scale used to tweak the material detail distances.
float lodScale
A global LOD scale used to tweak the default terrain screen error value.
Functions
getTerrainHeight(F32 x, F32 y)
Gets the terrain height at the specified position.
Parameters:
x | The X coordinate in world space |
y | The Y coordinate in world space |
Returns the terrain height at the given point as an F32 value.
getTerrainHeight(Point2I position)
Gets the terrain height at the specified position.
Parameters:
position | The world space point, minus the z (height) value. Formatted as ("x y") |
Returns the terrain height at the given point as an F32 value.
getTerrainHeightBelowPosition(F32 x, F32 y)
Takes a world point and find the "highest" terrain underneath it.
Parameters:
x | The X coordinate in world space |
y | The Y coordinate in world space |
Returns the closest terrain height below the given point as an F32 value.
getTerrainHeightBelowPosition(Point2I position)
Takes a world point and find the "highest" terrain underneath it.
Parameters:
position | The world space point, minus the z (height) value. Formatted as ("x y") |
Returns the closest terrain height below the given point as an F32 value.
getTerrainUnderWorldPoint(F32 x, F32 y, F32 z)
Takes a world point and find the "highest" terrain underneath it.
Parameters:
x | The X coordinate in world space |
y | The Y coordinate in world space |
z | The Z coordinate in world space |
Returns the ID of the requested terrain block (0 if not found).
getTerrainUnderWorldPoint(Point3F position)
Gets the terrain block that is located under the given world point.
Parameters:
position | The world space coordinate you wish to query at. Formatted as ("x y z") |
Returns the ID of the requested terrain block (0 if not found).