class
PhysicsShape
public sealed class PhysicsShape Represents a basic, convex shape. A PhysicsBody consists of one or more of these.
Properties
| Name | Type | Description |
|---|---|---|
Body | PhysicsBody | The physics body we belong to. |
Scale | Vector3 | |
Collider | Collider | The collider object that created / owns this shape |
IsTrigger | Boolean | This is a trigger (!) |
SurfaceVelocity | Vector3 | Set the local velocity of the surface so things can slide along it, like a conveyor belt |
EnableSolidCollisions | Boolean | Controls whether this shape has solid collisions. |
EnableTouch | Boolean | Controls whether this shape can fire touch events for its owning entity. (Entity.StartTouch, Touch and EndTouch) |
EnableTouchPersists | Boolean | Controls whether this shape can fire continuous touch events for its owning entity (i.e. calling Entity.Touch every frame) |
IsMeshShape | Boolean | Is this a MeshShape |
IsHullShape | Boolean | Is this a HullShape |
IsSphereShape | Boolean | Is this a SphereShape |
IsCapsuleShape | Boolean | Is this a CapsuleShape |
IsHeightfieldShape | Boolean | Is this a HeightfieldShape |
Sphere | Sphere | Get sphere properties if we're a sphere type |
Capsule | Capsule | Get capsule properties if we're a capsule type |
SurfaceMaterial | String | Controls physical properties of this shape. |
Surface | Surface | |
Surfaces | Surface[] | Multiple surfaces referenced by mesh or heightfield collision. |
Friction | Single | The friction value |
Tags | ITagSet |
Methods
Void EnableAllCollision() Enable contact, trace and touch
Void DisableAllCollision() Disable contact, trace and touch
Void UpdateMesh(List<Vector3> vertices, List<Int32> indices) Void UpdateMesh(Span<Vector3> vertices, Span<Int32> indices) Void Remove() Remove this shape. After calling this the shape should be considered released and not used again.
Void Triangulate(Vector3[] positions, UInt32[] indices) Triangulate this shape.
Boolean HasTag(String tag) Does this shape have a specific tag?
Boolean AddTag(String tag) Add a tag to this shape.
Boolean RemoveTag(String tag) Remove a tag from this shape.
Boolean ClearTags() Clear all tags from this shape.