# CollisionSurface record

> What a collider is made of: a surface record's id, a material's id whose surface stands in for it, both or neither. A ColliderShape and each MeshPart carry one, and footsteps, impacts and bullet holes read it where something touches.

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

```csharp
public sealed record CollisionSurface
```

What a collider is made of: a `surface` record's id, a material's id whose surface stands in for it, both or neither. A [ColliderShape](/docs/api/collidershape#surface) and each [MeshPart](/docs/api/meshpart) carry one, and footsteps, impacts and bullet holes read it where something touches.

```csharp
new ColliderShape.Box(new Vector3(1, 1, 1)) { Surface = new CollisionSurface(ContentId.Parse("gmod:surfaces/wood"), null) }
```

## Members

### CollisionSurface (constructor)

```csharp
public CollisionSurface(ContentId? Surface, ContentId? Material)
```

Makes a surface from a surface record's id and a material's id, either of them `null`.

### None (field)

```csharp
public static readonly CollisionSurface None
```

Neither a surface nor a material, what a shape has unless it's given one.

### Surface (property)

```csharp
public ContentId? Surface { get; init; }
```

The `surface` record's id, or `null`. A body made through [IPhysicsWorld.Add](/docs/api/iphysicsworld#add) takes its friction, bounce and density from the first collider that names one.

### Material (property)

```csharp
public ContentId? Material { get; init; }
```

The id of a material whose own surface stands in when [Surface](#surface) is `null`, as a map's brushes name theirs, or `null`. Map collision and placed models read it; a body made through [IPhysicsWorld.Add](/docs/api/iphysicsworld#add) doesn't.
