# `Cauldron3D.Hull`
[🔗](https://github.com/jaman/cauldron/blob/v0.2.2/cauldron_3d/lib/cauldron_3d/hull.ex#L1)

A collision hull: a BSP tree of planes whose leaves are only contents, swept by a point.

A box moves through a world by tracing a point through a hull whose walls are pushed
out by the box's size; a world keeps one hull per box size it allows. A thing's own
box is a hull too (`box/2`).

    trace = Cauldron3D.Hull.trace(hull, from, to)
    trace.fraction

`clipnodes` is a tuple of `{plane, front, back}`, the plane an index into `planes`
(`{normal, distance}`); a child at or above zero is another clipnode, below zero a
contents value (see `Cauldron3D.Bsp`). `head` is the clipnode to start from, and
`mins` and `maxs` the box the hull was pushed out by.

# `t`

```elixir
@type t() :: %Cauldron3D.Hull{
  clipnodes: tuple(),
  head: integer(),
  maxs: Cauldron3D.Vec.t(),
  mins: Cauldron3D.Vec.t(),
  planes: tuple()
}
```

# `at`

```elixir
@spec at(t(), integer()) :: t()
```

The hull starting at clipnode `head` instead.

# `box`

```elixir
@spec box(Cauldron3D.Vec.t(), Cauldron3D.Vec.t()) :: t()
```

A hull that is solid inside the box `mins`..`maxs` and empty outside, for tracing past
a thing.

# `contents`

```elixir
@spec contents(t(), Cauldron3D.Vec.t()) :: integer()
```

The contents at `point`.

# `trace`

```elixir
@spec trace(t(), Cauldron3D.Vec.t(), Cauldron3D.Vec.t()) :: Cauldron3D.Hull.Trace.t()
```

A point moved in a straight line from `from` to `to` through the hull, stopped by the
first solid it meets.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
