s&box docs

public abstract class Sandbox.Collider : Sandbox.Component

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 10 methods

protected void CalculateLocalBounds()

protected void ConfigureShapes()

Apply any things that we an apply after they're created

public Vector3 FindClosestPoint(Vector3 worldPoint)

Returns the closest point to the given one between all convex shapes of this body.

public Vector3 GetVelocityAtPoint(Vector3 worldPoint)

Get the velocity of this collider at the specific point in world coordinates.

public BBox GetWorldBounds()

Get the world bounds of this object

public void OnPhysicsChanged()Obsolete

Obsolete: This API member is obsolete.

protected void Rebuild()

protected virtual void RebuildImmediately()

Properties

Showing 19 properties

public System.Nullable`1<float> Sandbox.Collider.Elasticity { get; set; }

Allows overriding the elasticity for this collider. Controls how bouncy this collider is.

public System.Nullable`1<float> Sandbox.Collider.Friction { get; set; }

Allows overriding the friction for this collider. This value can exceed 1 to to give crazy grippy friction if you want it to, but the normal value is between 0 and 1.

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

public bool Sandbox.Collider.IsDynamic { get; set; }

Return true if this collider is using dynamic physics. Returns false if this is a keyframe body, or a static physics body.

public bool Sandbox.Collider.IsTrigger { get; set; }

public System.Collections.Generic.IReadOnlySet`1<Sandbox.Joint> Sandbox.Collider.Joints { get; set; }

If we're a keyframe collider, this is the set of joints attached to us. If we're not then this won't ever return anything.

public Sandbox.PhysicsBody Sandbox.Collider.KeyframeBody { get; set; }Obsolete

Obsolete: We no longer offer a way to get the KeyframeBody. What do you want to do?

public virtual sealed BBox Sandbox.Collider.LocalBounds { get; set; }

Calculated local bounds of all physics shapes in this collider.

public System.Action`1<Sandbox.GameObject> Sandbox.Collider.OnObjectTriggerEnter { get; set; }

Called when a gameobject enters this trigger

public System.Action`1<Sandbox.GameObject> Sandbox.Collider.OnObjectTriggerExit { get; set; }

Called when a gameobject exits this trigger

public System.Action`1<Sandbox.Collider> Sandbox.Collider.OnTriggerEnter { get; set; }

Called when a collider enters this trigger

public System.Action`1<Sandbox.Collider> Sandbox.Collider.OnTriggerExit { get; set; }

Called when a collider exits this trigger

public Sandbox.Rigidbody Sandbox.Collider.Rigidbody { get; set; }

If this collider is part of a Rigidbody then this will return the component that it's attached to. If this is null it's usually a good indication that this collider is either static, world geometry, or a keyframe.

public System.Nullable`1<float> Sandbox.Collider.RollingResistance { get; set; }

Allows overriding the rolling resistance for this collider. Controls how easily rolling shapes (sphere, capsule) roll on surfaces.

public bool Sandbox.Collider.Static { get; set; }

public Vector3 Sandbox.Collider.SurfaceVelocity { get; set; }

Set the local velocity of the surface so things can slide along it, like a conveyor belt

public System.Collections.Generic.IEnumerable`1<Sandbox.Collider> Sandbox.Collider.Touching { get; set; }

If we're a trigger, this will list all of the colliders that are touching us. If we're not a trigger, this will list all of the triggers that we are touching.

Metadata

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

On this page

Constructorsprotected Collider()Methodsprotected System.Void CalculateLocalBounds()protected System.Void ConfigureShapes()protected virtual System.Collections.Generic.IEnumerable`1<Sandbox.PhysicsShape> CreatePhysicsShapes(Sandbox.PhysicsBody targetBody, Transform local)protected virtual System.Collections.Generic.IEnumerable`1<Sandbox.PhysicsShape> CreatePhysicsShapes(Sandbox.PhysicsBody targetBody)public Vector3 FindClosestPoint(Vector3 worldPoint)public Vector3 GetVelocityAtPoint(Vector3 worldPoint)public BBox GetWorldBounds()public System.Void OnPhysicsChanged()protected System.Void Rebuild()protected virtual System.Void RebuildImmediately()Propertiespublic Sandbox.ColliderFlags Sandbox.Collider.ColliderFlags { get; set; }public System.Nullable`1<System.Single> Sandbox.Collider.Elasticity { get; set; }public System.Nullable`1<System.Single> Sandbox.Collider.Friction { get; set; }public virtual System.Boolean Sandbox.Collider.IsConcave { get; set; }public System.Boolean Sandbox.Collider.IsDynamic { get; set; }public System.Boolean Sandbox.Collider.IsTrigger { get; set; }public System.Collections.Generic.IReadOnlySet`1<Sandbox.Joint> Sandbox.Collider.Joints { get; set; }public Sandbox.PhysicsBody Sandbox.Collider.KeyframeBody { get; set; }public virtual sealed BBox Sandbox.Collider.LocalBounds { get; set; }public System.Action`1<Sandbox.GameObject> Sandbox.Collider.OnObjectTriggerEnter { get; set; }public System.Action`1<Sandbox.GameObject> Sandbox.Collider.OnObjectTriggerExit { get; set; }public System.Action`1<Sandbox.Collider> Sandbox.Collider.OnTriggerEnter { get; set; }public System.Action`1<Sandbox.Collider> Sandbox.Collider.OnTriggerExit { get; set; }public Sandbox.Rigidbody Sandbox.Collider.Rigidbody { get; set; }public System.Nullable`1<System.Single> Sandbox.Collider.RollingResistance { get; set; }public System.Boolean Sandbox.Collider.Static { get; set; }public Sandbox.Surface Sandbox.Collider.Surface { get; set; }public Vector3 Sandbox.Collider.SurfaceVelocity { get; set; }public System.Collections.Generic.IEnumerable`1<Sandbox.Collider> Sandbox.Collider.Touching { get; set; }Metadata