Skip to content
EvilEngine.Formats.Collision

ColliderShape record

public abstract record ColliderShape

The shape of a Collider, centred on the collider’s own origin, in metres. It’s one of six records, and no other kind can be made:

  • Box, by its size along each axis.
  • Sphere, by its radius.
  • Capsule, a cylinder with round ends, along its Y axis.
  • Cylinder, along its Y axis.
  • Hull, the convex hull of a set of points, as Source’s .phy gives a prop’s.
  • Mesh, triangles that need not close, for things that never move.
new ColliderShape.Sphere(0.25f) { Surface = new CollisionSurface(ContentId.Parse("mygame:surfaces/rubber"), null) }
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

Surface property

public CollisionSurface Surface { get; init; }

What the shape is made of, as a CollisionSurface: the id of a surface record, or of a material whose surface stands in, or neither, CollisionSurface.None unless set. The surface gives footsteps, impacts and bullet holes, and a body made through IPhysicsWorld.Add takes its friction, bounce and density from the first of its colliders that names a surface record, unless BodySpec.Surface names one. That body doesn’t read a material’s surface. A Mesh gives each of its parts a surface of its own.