s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
Terrain
chevron_left
Classes
class
Terrain
search
Constructors
functions
Terrain
Properties
data_object
ClipMapLodExtentTexels
data_object
ClipMapLodLevels
data_object
ComponentVersion
data_object
ControlMap
data_object
EnableCollision
data_object
HeightMap
data_object
IsConcave
data_object
MaterialOverride
data_object
RenderType
data_object
Storage
data_object
SubdivisionFactor
data_object
SubdivisionLodCount
data_object
TerrainHeight
data_object
TerrainSize
Methods
functions
Create
functions
GetMaterialAtWorldPosition
functions
RayIntersects
functions
SyncCPUTexture
functions
SyncGPUTexture
functions
UpdateMaterialsBuffer
Terrain
Terrain renders heightmap based terrain.
class
Sandbox
.
account_tree
extends
Collider
sealed
Sandbox.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.