# CollisionBody record

> One part of a jointed collision, such as a ragdoll's forearm: which colliders it owns, where it sits in the model's bind pose, and how it moves. Source's .phy gives one for each solid of a model with more than one, named after the solid's bone.

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

```csharp
public sealed record CollisionBody
```

One part of a jointed [collision](/docs/api/collisioncontent), such as a ragdoll's forearm: which colliders it owns, where it sits in the model's bind pose, and how it moves. Source's `.phy` gives one for each solid of a model with more than one, named after the solid's bone.

When a body dies into a ragdoll, the host makes one dynamic physics body of each part with convex colliders, places it on its bone of the dying pose by [Name](#name), or at its bind pose when there's no pose or it has no such bone, and joins the parts by the collision's [Joints](/docs/api/collisioncontent#joints). A part with no convex collider is left out.

## Members

### CollisionBody (constructor)

```csharp
public CollisionBody(string Name, IReadOnlyList<int> Colliders)
```

Makes a part named `name` that owns `colliders`, at the model's origin, unturned, with its mass from its volume.

### Name (property)

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

The part's name. A Source ragdoll's is its bone's, which the ragdoll is posed and drawn by.

### Colliders (property)

```csharp
public IReadOnlyList<int> Colliders { get; init; }
```

The indices of the [Colliders](/docs/api/collisioncontent#colliders) the part owns. Each collider must be in exactly one part for the collision to be written.

### Position (property)

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

Where the part's origin is in the model's bind pose, in metres. Its colliders and its joints' frames are placed against it.

### Rotation (property)

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

How the part is turned in the bind pose, as a `System.Numerics.Quaternion`. Identity unless set.

### Mass (property)

```csharp
public double? Mass { get; init; }
```

The part's mass in kilograms, above 0, or `null` for its volume times its surface's density. A `.phy` solid's `mass`.

### Damping (property)

```csharp
public double? Damping { get; init; }
```

How much of its speed the part sheds each second, or `null` for the physics world's own. A `.phy` solid's `damping`.

### SpinDamping (property)

```csharp
public double? SpinDamping { get; init; }
```

How much of its spin the part sheds each second, or `null` for the physics world's own. A `.phy` solid's `rotdamping`.

### Inertia (property)

```csharp
public double? Inertia { get; init; }
```

A scale on the part's inertia, or `null` for 1. A `.phy` solid's `inertia`. The physics body carries it, but the physics world doesn't apply it yet.
