PhysicsShapeclass

Represents a basic, convex shape. A PhysicsBody consists of one or more of these.

objectPhysicsShape
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.PhysicsShape

Methods11

Showing 11 methods

public bool AddTag(string tag)PUBLICOBSOLETE

Add a tag to this shape.

Obsolete: Use Tags

ParameterTypeDescription
tagstring
Returns:bool

public bool ClearTags()PUBLICOBSOLETE

Clear all tags from this shape.

Obsolete: Use Tags

Returns:bool

public void DisableAllCollision()PUBLIC

Disable contact, trace and touch

Returns:void

public void EnableAllCollision()PUBLIC

Enable contact, trace and touch

Returns:void

public bool HasTag(string tag)PUBLICOBSOLETE

Does this shape have a specific tag?

Obsolete: Use Tags

ParameterTypeDescription
tagstring
Returns:bool

public void Remove()PUBLIC

Remove this shape. After calling this the shape should be considered released and not used again.

Returns:void

public bool RemoveTag(string tag)PUBLICOBSOLETE

Remove a tag from this shape.

Obsolete: Use Tags

ParameterTypeDescription
tagstring
Returns:bool

public void Triangulate(Vector3[] positions, uint[] indices)PUBLIC

Triangulate this shape.

ParameterTypeDescription
positionsVector3[]
indicesuint[]
Returns:void

Properties20

Showing 20 properties

public bool Sandbox.PhysicsShape.EnableSolidCollisions { get; set; }PUBLICGETSET

Controls whether this shape has solid collisions.

Returns:bool

public bool Sandbox.PhysicsShape.EnableTouch { get; set; }PUBLICGETSET

Controls whether this shape can fire touch events for its owning entity. (Entity.StartTouch, Touch and EndTouch)

Returns:bool

public bool Sandbox.PhysicsShape.EnableTouchPersists { get; set; }PUBLICGETSET

Controls whether this shape can fire continuous touch events for its owning entity (i.e. calling Entity.Touch every frame)

Returns:bool

public float Sandbox.PhysicsShape.Friction { get; set; }PUBLICGETSET

The friction value

Returns:float

public bool Sandbox.PhysicsShape.IsCapsuleShape { get; set; }PUBLICGETSET

Is this a CapsuleShape

Returns:bool

public bool Sandbox.PhysicsShape.IsHeightfieldShape { get; set; }PUBLICGETSET

Is this a HeightfieldShape

Returns:bool

public bool Sandbox.PhysicsShape.IsHullShape { get; set; }PUBLICGETSET

Is this a HullShape

Returns:bool

public bool Sandbox.PhysicsShape.IsMeshShape { get; set; }PUBLICGETSET

Is this a MeshShape

Returns:bool

public bool Sandbox.PhysicsShape.IsSphereShape { get; set; }PUBLICGETSET

Is this a SphereShape

Returns:bool

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

This is a trigger (!)

Returns:bool

public Vector3 Sandbox.PhysicsShape.Scale { get; set; }PUBLICGETSETOBSOLETE

Obsolete: This API member is obsolete.

Returns:Vector3

public string Sandbox.PhysicsShape.SurfaceMaterial { get; set; }PUBLICGETSET

Controls physical properties of this shape.

Returns:string

public Sandbox.Surface[] Sandbox.PhysicsShape.Surfaces { get; set; }PUBLICGETSET

Multiple surfaces referenced by mesh or heightfield collision.

Returns:Surface[]

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

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

Returns:Vector3

On this page

Methodspublic System.Boolean AddTag(System.String tag)public System.Boolean ClearTags()public System.Void DisableAllCollision()public System.Void EnableAllCollision()public System.Boolean HasTag(System.String tag)public System.Void Remove()public System.Boolean RemoveTag(System.String tag)public System.Void Triangulate(Vector3[] positions, System.UInt32[] indices)public System.Void UpdateHull(Vector3 position, Rotation rotation, System.Span`1<Vector3> points)public System.Void UpdateMesh(System.Collections.Generic.List`1<Vector3> vertices, System.Collections.Generic.List`1<System.Int32> indices)public System.Void UpdateMesh(System.Span`1<Vector3> vertices, System.Span`1<System.Int32> indices)Propertiespublic Sandbox.PhysicsBody Sandbox.PhysicsShape.Body { get; set; }public Capsule Sandbox.PhysicsShape.Capsule { get; set; }public Sandbox.Collider Sandbox.PhysicsShape.Collider { get; set; }public System.Boolean Sandbox.PhysicsShape.EnableSolidCollisions { get; set; }public System.Boolean Sandbox.PhysicsShape.EnableTouch { get; set; }public System.Boolean Sandbox.PhysicsShape.EnableTouchPersists { get; set; }public System.Single Sandbox.PhysicsShape.Friction { get; set; }public System.Boolean Sandbox.PhysicsShape.IsCapsuleShape { get; set; }public System.Boolean Sandbox.PhysicsShape.IsHeightfieldShape { get; set; }public System.Boolean Sandbox.PhysicsShape.IsHullShape { get; set; }public System.Boolean Sandbox.PhysicsShape.IsMeshShape { get; set; }public System.Boolean Sandbox.PhysicsShape.IsSphereShape { get; set; }public System.Boolean Sandbox.PhysicsShape.IsTrigger { get; set; }public Vector3 Sandbox.PhysicsShape.Scale { get; set; }public Sandbox.Sphere Sandbox.PhysicsShape.Sphere { get; set; }public Sandbox.Surface Sandbox.PhysicsShape.Surface { get; set; }public System.String Sandbox.PhysicsShape.SurfaceMaterial { get; set; }public Sandbox.Surface[] Sandbox.PhysicsShape.Surfaces { get; set; }public Vector3 Sandbox.PhysicsShape.SurfaceVelocity { get; set; }public Sandbox.ITagSet Sandbox.PhysicsShape.Tags { get; set; }Metadata