# ColliderShape.Mesh record

> A collider shape of triangles, which need not close or be convex, for the world and things that never move: a map's displacements, a Bunker or Overgrowth model's own collision. A body holding one can only be static or kinematic. IPhysicsWorld.Add refuses a dynamic one with ArgumentException, and it counts no volume toward a body's mass. In a body made there, its triangles collide from both sides.

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

```csharp
public sealed record ColliderShape.Mesh : ColliderShape
```

A [collider shape](/docs/api/collidershape) of triangles, which need not close or be convex, for the world and things that never move: a map's displacements, a Bunker or Overgrowth model's own collision. A body holding one can only be static or kinematic. [IPhysicsWorld.Add](/docs/api/iphysicsworld#add) refuses a dynamic one with `ArgumentException`, and it counts no volume toward a body's mass. In a body made there, its triangles collide from both sides.

```csharp
var floor = new ColliderShape.Mesh([
    new MeshPart([new(-5, 0, -5), new(5, 0, -5), new(-5, 0, 5), new(5, 0, 5)], [0, 2, 1, 1, 2, 3], CollisionSurface.None)
]);
```

## Members

### ColliderShape.Mesh (constructor)

```csharp
public ColliderShape.Mesh(IReadOnlyList<MeshPart> Parts)
```

Makes a mesh of `parts`.

### Parts (property)

```csharp
public IReadOnlyList<MeshPart> Parts { get; init; }
```

The mesh's parts, each a `MeshPart` of corners in metres, triangles as three indices into them each, and its own `CollisionSurface`, so one mesh can be concrete in one place and metal in another. The mesh's own [Surface](/docs/api/collidershape#surface) isn't written: its parts' are. It needs at least one part, and every part whole triangles of its own corners, to be written.
