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
Surface
chevron_left
Classes
class
Surface
search
Constructors
functions
Surface
Properties
data_object
AudioSurface
data_object
BaseSurface
data_object
BounceThreshold
remove_circle
Dampening
data_object
Density
data_object
Description
data_object
Elasticity
data_object
FluidAngularDrag
data_object
FluidLinearDrag
data_object
Friction
remove_circle
ImpactEffects
data_object
Index
data_object
NameHash
data_object
PrefabCollection
data_object
RollingResistance
remove_circle
ScrapeEffects
data_object
SoundCollection
remove_circle
Sounds
data_object
Tags
Methods
lock
CreateAssetTypeIcon
functions
GetBaseSurface
functions
HasAllTags
functions
HasAnyTags
functions
HasTag
lock
OnDestroy
functions
PlayCollisionSound
lock
PostLoad
lock
PostReload
functions
SetBaseSurface
Static Methods
functions
FindByName
Surface
A physics surface. This is applied to each <see cref="T:Sandbox.PhysicsShape">PhysicsShape</see> and controls its physical properties and physics related sounds.
class
Sandbox
.
account_tree
extends
GameResource
Sandbox.Engine
build
Constructors
1
Surface
(
)
data_object
Properties
19
AudioSurface
AudioSurface
Defines the audio properties of this surface for Steam Audio
BaseSurface
string
Filepath of the base surface. Use
SetBaseSurface
and
GetBaseSurface
.
BounceThreshold
float
Velocity threshold, below which objects will not bounce due to their elasticity.
Dampening
obsolete
float
Density
float
Density of this surface material. This affects things like automatic mass calculation. Density is in kg/m^3.
Description
string
A concise description explaining what this surface property should be used for.
Elasticity
float
Controls bounciness.
FluidAngularDrag
float
Angular drag applied when submerged.
FluidLinearDrag
float
Linear drag applied when submerged.
Friction
float
Friction of this surface material.
ImpactEffects
obsolete
ImpactEffectData
Impact effects of this surface material.
Index
int
NameHash
UInt32
PrefabCollection
SurfacePrefabCollection
Common prefabs for this surface material
RollingResistance
float
Controls how easily rolling shapes (sphere, capsule) roll on surfaces.
ScrapeEffects
obsolete
ScrapeEffectData
Scrape effects of this surface material.
SoundCollection
SurfaceSoundCollection
Sounds for this surface material
Sounds
obsolete
OldSoundData
Sounds associated with this surface material.
Tags
string
A list of tags as one string.
functions
Methods
10
CreateAssetTypeIcon
(
width
,
height
)
Bitmap
GetBaseSurface
(
)
Surface
Returns the base surface of this surface, or null if we are the default surface.
HasAllTags
(
tags
)
bool
Do we have all the tags on this hitbox?
HasAnyTags
(
tags
)
bool
Do we have all the tags on this hitbox?
HasTag
(
tag
)
bool
Do we have a tag?
OnDestroy
(
)
PlayCollisionSound
(
position
,
speed
)
SoundHandle
Play a collision sound based on this shape's surface. Can return null if sound is invalid, or too quiet to play.
PostLoad
(
)
PostReload
(
)
SetBaseSurface
(
name
)
Sets the base surface by name.
functions
Static Methods
1
FindByName
(
name
)
Surface
Returns a Surface from its name, or null
Inheritance
Resource
GameResource
Surface
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.