s&box docs

public sealed class Sandbox.Terrain : Sandbox.Collider

Terrain renders heightmap based terrain.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 6 methods

public void Create()

Call on enable or storage change

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.

public bool RayIntersects(Ray ray, float distance, Vector3 position)

Given a world ray, finds out the LOCAL position it intersects with this terrain.

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.

public void SyncGPUTexture()

Updates the GPU texture maps with the CPU data

public void UpdateMaterialsBuffer()

Upload the Materials buffer, this should be called when materials are added, removed or modified.

Properties

Showing 14 properties

public int Sandbox.Terrain.ClipMapLodExtentTexels { get; set; }

public int Sandbox.Terrain.ClipMapLodLevels { get; set; }

public virtual int Sandbox.Terrain.ComponentVersion { get; set; }

public bool Sandbox.Terrain.EnableCollision { get; set; }

public virtual bool Sandbox.Terrain.IsConcave { get; set; }

public int Sandbox.Terrain.SubdivisionFactor { get; set; }

public int Sandbox.Terrain.SubdivisionLodCount { get; set; }

public float Sandbox.Terrain.TerrainHeight { get; set; }

World size of the maximum height of the terrain.

public float Sandbox.Terrain.TerrainSize { get; set; }

Uniform world size of the width and length of the terrain.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Terrain

On this page