Surfaceclass
A physics surface. This is applied to each PhysicsShape and controls its physical properties and physics related sounds.
Constructors1
Showing 1 constructors
public Surface()
No results match this filter.
Methods11
Showing 11 methods
protected virtual Sandbox.Bitmap CreateAssetTypeIcon(int width, int height)
| Parameter | Type | Description |
|---|---|---|
| width | int | — |
| height | int | — |
public static Sandbox.Surface FindByName(string name)
Returns a Surface from its name, or null
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of a surface property to look up |
public Sandbox.Surface GetBaseSurface()
Returns the base surface of this surface, or null if we are the default surface.
public bool HasAllTags(string[] tags)
Do we have all the tags on this hitbox?
| Parameter | Type | Description |
|---|---|---|
| tags | string[] | — |
boolTrue if all tags match, false if any tag does not match.public bool HasAnyTags(string[] tags)
Do we have all the tags on this hitbox?
| Parameter | Type | Description |
|---|---|---|
| tags | string[] | — |
boolTrue if any tag matches, false if all tags do not match.public bool HasTag(string tag)
Do we have a tag?
| Parameter | Type | Description |
|---|---|---|
| tag | string | — |
bool—protected virtual void OnDestroy()
void—public Sandbox.SoundHandle PlayCollisionSound(Vector3 position, float speed = 320)
Play a collision sound based on this shape's surface. Can return null if sound is invalid, or too quiet to play.
| Parameter | Type | Description |
|---|---|---|
| position | Vector3 | — |
| speed = 320 | float | — |
protected virtual void PostLoad()
void—protected virtual void PostReload()
void—public void SetBaseSurface(string name)
Sets the base surface by name.
| Parameter | Type | Description |
|---|---|---|
| name | string | — |
void—No results match this filter.
Properties19
Showing 19 properties
public Sandbox.AudioSurface Sandbox.Surface.AudioSurface { get; set; }
Defines the audio properties of this surface for Steam Audio
public string Sandbox.Surface.BaseSurface { get; set; }
Filepath of the base surface. Use SetBaseSurface and GetBaseSurface.
string—public float Sandbox.Surface.BounceThreshold { get; set; }
Velocity threshold, below which objects will not bounce due to their elasticity.
float—public float Sandbox.Surface.Dampening { get; set; }
Obsolete: This API member is obsolete.
float—public float Sandbox.Surface.Density { get; set; }
Density of this surface material. This affects things like automatic mass calculation. Density is in kg/m^3.
float—public string Sandbox.Surface.Description { get; set; }
A concise description explaining what this surface property should be used for.
string—public float Sandbox.Surface.Elasticity { get; set; }
Controls bounciness.
float—public float Sandbox.Surface.FluidAngularDrag { get; set; }
Angular drag applied when submerged.
float—public float Sandbox.Surface.FluidLinearDrag { get; set; }
Linear drag applied when submerged.
float—public float Sandbox.Surface.Friction { get; set; }
Friction of this surface material.
float—public Sandbox.Surface.ImpactEffectData Sandbox.Surface.ImpactEffects { get; set; }
Impact effects of this surface material.
Obsolete: This API member is obsolete.
public int Sandbox.Surface.Index { get; set; }
int—public uint Sandbox.Surface.NameHash { get; set; }
uint—public Sandbox.Surface.SurfacePrefabCollection Sandbox.Surface.PrefabCollection { get; set; }
Common prefabs for this surface material
public float Sandbox.Surface.RollingResistance { get; set; }
Controls how easily rolling shapes (sphere, capsule) roll on surfaces.
float—public Sandbox.Surface.ScrapeEffectData Sandbox.Surface.ScrapeEffects { get; set; }
Scrape effects of this surface material.
Obsolete: This API member is obsolete.
public Sandbox.Surface.SurfaceSoundCollection Sandbox.Surface.SoundCollection { get; set; }
Sounds for this surface material
public Sandbox.Surface.OldSoundData Sandbox.Surface.Sounds { get; set; }
Sounds associated with this surface material.
Obsolete: This API member is obsolete.
public string Sandbox.Surface.Tags { get; set; }
A list of tags as one string.
string—No results match this filter.