PhysicsShapeclass
Represents a basic, convex shape. A PhysicsBody consists of one or more of these.
Methods11
Showing 11 methods
public bool AddTag(string tag)
Add a tag to this shape.
Obsolete: Use Tags
| Parameter | Type | Description |
|---|---|---|
| tag | string | — |
bool—public bool ClearTags()
Clear all tags from this shape.
Obsolete: Use Tags
bool—public void DisableAllCollision()
Disable contact, trace and touch
void—public void EnableAllCollision()
Enable contact, trace and touch
void—public bool HasTag(string tag)
Does this shape have a specific tag?
Obsolete: Use Tags
| Parameter | Type | Description |
|---|---|---|
| tag | string | — |
bool—public void Remove()
Remove this shape. After calling this the shape should be considered released and not used again.
void—public bool RemoveTag(string tag)
Remove a tag from this shape.
Obsolete: Use Tags
| Parameter | Type | Description |
|---|---|---|
| tag | string | — |
bool—public void Triangulate(Vector3[] positions, uint[] indices)
Triangulate this shape.
| Parameter | Type | Description |
|---|---|---|
| positions | Vector3[] | — |
| indices | uint[] | — |
void—public void UpdateHull(Vector3 position, Rotation rotation, System.Span`1<Vector3> points)
| Parameter | Type | Description |
|---|---|---|
| position | Vector3 | — |
| rotation | Rotation | — |
| points | Span<Vector3> | — |
void—No results match this filter.
Properties20
Showing 20 properties
public Sandbox.PhysicsBody Sandbox.PhysicsShape.Body { get; set; }
The physics body we belong to.
public Capsule Sandbox.PhysicsShape.Capsule { get; set; }
Get capsule properties if we're a capsule type
public Sandbox.Collider Sandbox.PhysicsShape.Collider { get; set; }
The collider object that created / owns this shape
public bool Sandbox.PhysicsShape.EnableSolidCollisions { get; set; }
Controls whether this shape has solid collisions.
bool—public bool Sandbox.PhysicsShape.EnableTouch { get; set; }
Controls whether this shape can fire touch events for its owning entity. (Entity.StartTouch, Touch and EndTouch)
bool—public bool Sandbox.PhysicsShape.EnableTouchPersists { get; set; }
Controls whether this shape can fire continuous touch events for its owning entity (i.e. calling Entity.Touch every frame). Persist events are only sent while the contact is awake, sleeping contacts don't emit them.
bool—public float Sandbox.PhysicsShape.Friction { get; set; }
The friction value
float—public bool Sandbox.PhysicsShape.IsCapsuleShape { get; set; }
Is this a CapsuleShape
bool—public bool Sandbox.PhysicsShape.IsHeightfieldShape { get; set; }
Is this a HeightfieldShape
bool—public bool Sandbox.PhysicsShape.IsHullShape { get; set; }
Is this a HullShape
bool—public bool Sandbox.PhysicsShape.IsMeshShape { get; set; }
Is this a MeshShape
bool—public bool Sandbox.PhysicsShape.IsSphereShape { get; set; }
Is this a SphereShape
bool—public bool Sandbox.PhysicsShape.IsTrigger { get; set; }
This is a trigger (!)
bool—public Vector3 Sandbox.PhysicsShape.Scale { get; set; }
Obsolete: This API member is obsolete.
public Sandbox.Sphere Sandbox.PhysicsShape.Sphere { get; set; }
Get sphere properties if we're a sphere type
public Sandbox.Surface Sandbox.PhysicsShape.Surface { get; set; }
public string Sandbox.PhysicsShape.SurfaceMaterial { get; set; }
Controls physical properties of this shape.
string—public Sandbox.Surface[] Sandbox.PhysicsShape.Surfaces { get; set; }
Multiple surfaces referenced by mesh or heightfield collision.
public Vector3 Sandbox.PhysicsShape.SurfaceVelocity { get; set; }
Set the local velocity of the surface so things can slide along it, like a conveyor belt
public Sandbox.ITagSet Sandbox.PhysicsShape.Tags { get; set; }
No results match this filter.