Colliderclass

objectComponentCollider
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public abstract class Sandbox.Collider : Sandbox.Component

Constructors1

Showing 1 constructors

protected Collider()PROTECTEDCONSTRUCTOR

Methods10

Showing 10 methods

protected void CalculateLocalBounds()PROTECTED

Returns:void

protected void ConfigureShapes()PROTECTED

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

Returns:void

public Vector3 FindClosestPoint(Vector3 worldPoint)PUBLIC

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

ParameterTypeDescription
worldPointVector3
Returns:Vector3

public Vector3 GetVelocityAtPoint(Vector3 worldPoint)PUBLIC

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

ParameterTypeDescription
worldPointVector3
Returns:Vector3

public BBox GetWorldBounds()PUBLIC

Get the world bounds of this object

Returns:BBox

public void OnPhysicsChanged()PUBLICOBSOLETE

Obsolete: This API member is obsolete.

Returns:void

protected void Rebuild()PROTECTED

Returns:void

protected virtual void RebuildImmediately()PROTECTEDVIRTUAL

Returns:void

Properties19

Showing 19 properties

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

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

Returns:Nullable<float>

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

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.

Returns:Nullable<float>

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

Returns:bool

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

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

Returns:bool

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

Returns:bool

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

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.

Returns:IReadOnlySet<Joint>

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

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

Returns:PhysicsBody

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

Calculated local bounds of all physics shapes in this collider.

Returns:BBox

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

Called when a gameobject enters this trigger

Returns:Action<GameObject>

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

Called when a gameobject exits this trigger

Returns:Action<GameObject>

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

Called when a collider enters this trigger

Returns:Action<Collider>

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

Called when a collider exits this trigger

Returns:Action<Collider>

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

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.

Returns:Rigidbody

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

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

Returns:Nullable<float>

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

Returns:bool

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

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

Returns:Vector3

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

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.

Returns:IEnumerable<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