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.fractionclipnodes 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.
Summary
Functions
The hull starting at clipnode head instead.
A hull that is solid inside the box mins..maxs and empty outside, for tracing past
a thing.
The contents at point.
A point moved in a straight line from from to to through the hull, stopped by the
first solid it meets.
Types
@type t() :: %Cauldron3D.Hull{ clipnodes: tuple(), head: integer(), maxs: Cauldron3D.Vec.t(), mins: Cauldron3D.Vec.t(), planes: tuple() }
Functions
The hull starting at clipnode head instead.
@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.
@spec contents(t(), Cauldron3D.Vec.t()) :: integer()
The contents at point.
@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.