Urho.Terrain Class

Heightmap terrain component.

See Also: Terrain

Syntax

public class Terrain : Component

Requirements

Namespace: Urho
Assembly: Urho (in Urho.dll)
Assembly Versions: 1.0.0.0

The members of Urho.Terrain are listed below.

See Also: Component

Public Constructors

Constructs a new instance of Urho.Terrain which is tied to the Application.CurrentContext.
Constructs a new instance of Urho.Terrain, given a raw pointer to an unmanaged object
Constructs a new instance of Urho.Terrain linked to a specific Context.

Protected Constructors

Empty constructor, chain to this constructor when you provide your own constructor that sets the handle field.

Public Properties

CastShadowsBoolean. Return shadowcaster flag. Or Set shadowcaster flag for patches.
DrawDistanceSingle. Return draw distance. Or Set draw distance for patches.
EastNeighborTerrain. Return east neighbor terrain. Or Set east (positive X) neighbor terrain for seamless LOD changes across terrains.
[read-only]
HeightMapImage. Return heightmap image.
[read-only]
HeightMapAttrResourceRef. Return heightmap attribute.
LightMaskUInt32. Return light mask. Or Set light mask for patches. Is and'ed with light's and zone's light mask to see if the object should be lit.
LodBiasSingle. Return LOD bias. Or Set LOD bias for patches. Affects which terrain LOD to display.
MaterialMaterial. Return material. Or Set material.
[read-only]
MaterialAttrResourceRef. Return material attribute.
MaxLightsUInt32. Return maximum number of per-pixel lights. Or Set maximum number of per-pixel lights for patches. Default 0 is unlimited.
MaxLodLevelsUInt32. Return maximum number of LOD levels for terrain patches. This can be between 1-4. Or Set maximum number of LOD levels for terrain patches. This can be between 1-4.
NorthNeighborTerrain. Return north neighbor terrain. Or Set north (positive Z) neighbor terrain for seamless LOD changes across terrains.
[read-only]
NumPatchesIntVector2. Return heightmap size in patches.
[read-only]
NumVerticesIntVector2. Return heightmap size in vertices.
OccludeeBoolean. Controls the Occludee flag for patches.
OccluderBoolean. Controls the Occluder flag for patches.
OcclusionLodLevelUInt32. Return LOD level used for occlusion. Or Set LOD level used for terrain patch occlusion. By default (M_MAX_UNSIGNED) the coarsest. Since the LOD level used needs to be fixed, using finer LOD levels may result in false positive occlusion in cases where the actual rendered geometry is coarser, so use with caution.
PatchSizeInt32. Return patch quads per side. Or Set patch quads per side. Must be a power of two.
ShadowDistanceSingle. Return shadow draw distance. Or Set shadow draw distance for patches.
ShadowMaskUInt32. Return shadow mask. Or Set shadow mask for patches. Is and'ed with light's light mask and zone's shadow mask to see if the object should be rendered to a shadow map.
SmoothingBoolean. Return whether smoothing is in use. Or Set smoothing of heightmap.
SouthNeighborTerrain. Return south neighbor terrain. Or Set south (negative Z) neighbor terrain for seamless LOD changes across terrains.
SpacingVector3. Return vertex and height spacing. Or Set vertex (XZ) and height (Y) spacing.
[read-only]
override
TypeStringHash. Urho's type system type.
[read-only]
override
TypeNameString. Urho's low-level type name.
[read-only]
static
TypeNameStaticString. Urho's low-level type name, accessible as a static method.
[read-only]
static
TypeStaticStringHash. Urho's low-level type, accessible as a static method.
ViewMaskUInt32. Return view mask. Or Set view mask for patches. Is and'ed with camera's view mask to see if the object should be rendered.
[read-only]
VisibleBoolean. Return visible flag.
WestNeighborTerrain. Return west neighbor terrain. Or Set west (negative X) neighbor terrain for seamless LOD changes across terrains.
ZoneMaskUInt32. Return zone mask. Or Set zone mask for patches. Is and'ed with zone's zone mask to see if the object should belong to the zone.

Public Methods

override
ApplyAttributes()
Apply attribute changes that can not be applied immediately. Called after scene load or a network update.
ApplyHeightMap()
Apply changes from the heightmap image.
CreatePatchGeometry(TerrainPatch)
Regenerate patch geometry.
GetHeight(Vector3) : Single
Return height at world coordinates.
GetNeighborPatch(Int32, Int32) : TerrainPatch
GetNormal(Vector3) : Vector3
Return normal at world coordinates.
GetPatch(UInt32) : TerrainPatch
Return patch by index.
GetPatch(Int32, Int32) : TerrainPatch
Return patch by patch coordinates.
override
OnSetEnabled()
Handle enabled/disabled state change.
static
RegisterObject(Context)
Register object factory.
SetHeightMap(Image) : Boolean
Set heightmap image. Dimensions should be a power of two + 1. Uses 8-bit grayscale, or optionally red as MSB and green as LSB for 16-bit accuracy. Return true if successful.
SetMaxLodLevelsAttr(UInt32)
Set max LOD levels attribute.
SetNeighbors(Terrain, Terrain, Terrain, Terrain)
SetOcclusionLodLevelAttr(UInt32)
Set occlusion LOD level attribute.
SetPatchSizeAttr(Int32)
Set patch size attribute.
SubscribeToTerrainCreated(Action<TerrainCreatedEventArgs>) : Subscription
Subscribes to the TerrainCreated event raised by the Terrain.
UpdatePatchLod(TerrainPatch)
Update patch based on LOD and neighbor LOD.
WorldToHeightMap(Vector3) : IntVector2
Convert world position to heightmap pixel position. Note that the internal height data representation is reversed vertically, but in the heightmap image north is at the top.

Public Events