s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
Terrain
chevron_left Classes
class
Terrain

Constructors

functionsTerrain

Properties

data_objectClipMapLodExtentTexelsdata_objectClipMapLodLevelsdata_objectComponentVersiondata_objectControlMapdata_objectEnableCollisiondata_objectHeightMapdata_objectIsConcavedata_objectMaterialOverridedata_objectRenderTypedata_objectStoragedata_objectSubdivisionFactordata_objectSubdivisionLodCountdata_objectTerrainHeightdata_objectTerrainSize

Methods

functionsCreatefunctionsGetMaterialAtWorldPositionfunctionsRayIntersectsfunctionsSyncCPUTexturefunctionsSyncGPUTexturefunctionsUpdateMaterialsBuffer
Terrain
Terrain renders heightmap based terrain.
class Sandbox .account_tree extends Collider
sealedSandbox.Engine

build Constructors 1

Terrain ()

data_object Properties 14

ClipMapLodExtentTexels
int
ClipMapLodLevels
int
ComponentVersion
int
ControlMap
Texture
EnableCollision
bool
HeightMap
Texture
IsConcave
bool
MaterialOverride
Material
RenderType
ShadowRenderType
Storage
TerrainStorage
SubdivisionFactor
int
SubdivisionLodCount
int
TerrainHeight
float
World size of the maximum height of the terrain.
TerrainSize
float
Uniform world size of the width and length of the terrain.

functions Methods 6

Create ()
Call on enable or storage change
GetMaterialAtWorldPosition (worldPosition)
Nullable`1
Gets terrain material information at a world position. Returns null if the position is outside terrain bounds.
RayIntersects (ray, distance, position)
bool
Given a world ray, finds out the LOCAL position it intersects with this terrain.
SyncCPUTexture (flags, 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.
SyncGPUTexture ()
Updates the GPU texture maps with the CPU data
UpdateMaterialsBuffer ()
Upload the Materials buffer, this should be called when materials are added, removed or modified.

Inheritance

Component
Collider
Terrain
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter