# ColliderShape record

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

Namespace `EvilEngine.Formats.Collision`, assembly `EvilEngine.Formats`. Engine commit 4ff877b1.

```csharp
public abstract record ColliderShape
```

The shape of a [Collider](/docs/api/collider), centred on the collider's own origin, in metres. It's one of six records, and no other kind can be made:

- [Box](/docs/api/collidershape-box), by its size along each axis.
- [Sphere](/docs/api/collidershape-sphere), by its radius.
- [Capsule](/docs/api/collidershape-capsule), a cylinder with round ends, along its Y axis.
- [Cylinder](/docs/api/collidershape-cylinder), along its Y axis.
- [Hull](/docs/api/collidershape-hull), the convex hull of a set of points, as Source's `.phy` gives a prop's.
- [Mesh](/docs/api/collidershape-mesh), triangles that need not close, for things that never move.

```csharp
new ColliderShape.Sphere(0.25f) { Surface = new CollisionSurface(ContentId.Parse("mygame:surfaces/rubber"), null) }
```

## Members

### Surface (property)

```csharp
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](/docs/api/iphysicsworld#add) takes its friction, bounce and density from the first of its colliders that names a surface record, unless [BodySpec.Surface](/docs/api/bodyspec#surface) names one. That body doesn't read a material's surface. A [Mesh](/docs/api/collidershape-mesh) gives each of its parts a surface of its own.
