Terrainclass
Terrain renders heightmap based terrain.
Constructors1
Showing 1 constructors
public Terrain()
No results match this filter.
Methods8
Showing 8 methods
public void Create()
Call on enable or storage change
void—public System.Nullable`1<Sandbox.Terrain.TerrainMaterialInfo> GetMaterialAtWorldPosition(Vector3 worldPosition)
Gets terrain material information at a world position. Returns null if the position is outside terrain bounds.
| Parameter | Type | Description |
|---|---|---|
| worldPosition | Vector3 | — |
public void SyncCPUTexture(Sandbox.Terrain.SyncFlags flags, Sandbox.RectInt region)
Downloads dirty regions from the GPU texture maps onto the CPU, updating collider data and making changes saveable. This is used from the editor after modifying.
| Parameter | Type | Description |
|---|---|---|
| flags | SyncFlags | — |
| region | RectInt | — |
void—public void SyncGPUTexture()
Updates the GPU texture maps with the CPU data
void—public void UpdateCollision(Sandbox.Terrain.SyncFlags flags, Sandbox.RectInt region)
Update the collider heights/materials from the current CPU data for a region.
| Parameter | Type | Description |
|---|---|---|
| flags | SyncFlags | — |
| region | RectInt | — |
void—public void UpdateMaterialsBuffer()
Upload the Materials buffer, this should be called when materials are added, removed or modified.
void—No results match this filter.
Properties14
Showing 14 properties
public Sandbox.RenderAttributes Sandbox.Terrain.Attributes { get; set; }
Attributes that are applied to the terrain based on the current material and shader. If the terrain is disabled, the changes are deferred until it is enabled again. Attributes are not saved to disk, and are not cloned when copying the terrain.
public int Sandbox.Terrain.ClipMapLodExtentTexels { get; set; }
int—public int Sandbox.Terrain.ClipMapLodLevels { get; set; }
int—public virtual int Sandbox.Terrain.ComponentVersion { get; set; }
int—public bool Sandbox.Terrain.EnableCollision { get; set; }
bool—public virtual bool Sandbox.Terrain.IsConcave { get; set; }
bool—public Sandbox.ModelRenderer.ShadowRenderType Sandbox.Terrain.RenderType { get; set; }
public Sandbox.TerrainStorage Sandbox.Terrain.Storage { get; set; }
public int Sandbox.Terrain.SubdivisionFactor { get; set; }
How many times to subdivide each block mesh (1 = one vertex per heightmap texel). Higher adds displacement detail at the cost of more vertices.
int—public float Sandbox.Terrain.TerrainHeight { get; set; }
World size of the maximum height of the terrain.
float—public float Sandbox.Terrain.TerrainSize { get; set; }
Uniform world size of the width and length of the terrain.
float—No results match this filter.