# Collider record

> One shape of a collision: what shape it is, what it's made of, and where it sits about the collision's origin.

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

```csharp
public sealed record Collider
```

One shape of a [collision](/docs/api/collisioncontent): what shape it is, what it's made of, and where it sits about the collision's origin.

```csharp
var lid = new Collider(new ColliderShape.Box(new Vector3(0.8f, 0.05f, 0.8f)), ["solid"])
{
    Position = new Vector3(0, 0.4f, 0)
};
```

## Members

### Collider (constructor)

```csharp
public Collider(ColliderShape Shape, IReadOnlyList<string> Contents)
```

Makes a collider of `shape` and `contents` at the collision's origin, unturned and with no name.

### Shape (property)

```csharp
public ColliderShape Shape { get; init; }
```

The [ColliderShape](/docs/api/collidershape): a box, sphere, capsule, cylinder, convex hull or triangle mesh. Its [Surface](/docs/api/collidershape#surface) says what it's made of to footsteps, impacts and friction.

### Contents (property)

```csharp
public IReadOnlyList<string> Contents { get; init; }
```

What the collider is to things moving through it, as Source's brush contents are, each a name: `solid`, `window`, `grate` and `moveable` block everything, while `player_clip`, `npc_clip`, `vehicle_clip` and `physics_clip` block only players, NPCs, vehicles or props. `ladder`, `water`, `slime`, `lava`, `trigger`, `debris`, `detail`, `translucent`, `opaque` and `block_sight` are the rest. A collider needs at least one, and only these, to be written. Give a Plugin's own `solid`.

The map's colliders and the models placed in it collide by their contents. A body made through [IPhysicsWorld.Add](/docs/api/iphysicsworld#add) doesn't read them: it collides as a prop, with the world, physics clip and other props.

### Name (property)

```csharp
public string? Name { get; init; }
```

The collider's name, or `null`. A Source ragdoll's colliders take their solid's name, which is its bone's.

### Position (property)

```csharp
public Vector3 Position { get; init; }
```

Where the collider's own origin sits from the collision's, in metres. A box, sphere, capsule or cylinder is centred on it, and a hull's or mesh's points are about it. A jointed collision's colliders sit where they are in the model's own bind pose, not about their body.

### Rotation (property)

```csharp
public Quaternion Rotation { get; init; }
```

How the collider is turned about its own origin, as a `System.Numerics.Quaternion`. Identity unless set. A capsule or cylinder runs along its own Y axis, so turn it to lie another way.
