QuakeServer.World.Hulls (quake_server v0.1.0)

Copy Markdown View Source

Boxes moved through a brush model's collision hulls, stopped by the contents a mask of QuakeServer.Contents bits names.

choose/4 picks the hull a box of mins..maxs moves through and the offset from the box to that hull; trace/8 moves the box through it, in the model's own space, turned by axes when the model is turned; check/5 moves a point through one hull.

{hull, offset} = QuakeServer.World.Hulls.choose(model.hulls, 0, mins, maxs)
trace = QuakeServer.World.Hulls.trace(model.hulls, 0, nil, from, to, mins, maxs, mask)

hulls is a brush model's list, hull 0 first. A hull is there to use when the list holds it and, past hull 0, its first clipnode is one of its clipnodes.

Summary

Functions

Whether hull index of hulls is there to use.

A point moved from from to to through hull, stopped by leaves whose contents bits meet mask, carrying on from trace (Q1BSP_RecursiveHullCheck).

The hull a box of mins..maxs moves through, and what to take from a point of the box's to place it in that hull. force, from 1, names a hull to use when it is there; otherwise the box's width and height choose: under 3 wide the point hull, up to 32.1 wide hull 3 when under 54.1 high or else hull 1, wider hull 2, each falling back to a smaller hull that is there.

A box of mins..maxs moved from start to stop through a brush model's hulls, both points in the model's space before it is turned by axes (rows forward, left, up). force is as choose/4 takes it. The end and normal come back in that same unturned space.

Types

axes()

@type axes() :: {Cauldron3D.Vec.t(), Cauldron3D.Vec.t(), Cauldron3D.Vec.t()} | nil

Functions

available?(hulls, index)

@spec available?([Cauldron3D.Hull.t()], non_neg_integer()) :: boolean()

Whether hull index of hulls is there to use.

check(hull, from, to, mask, trace)

A point moved from from to to through hull, stopped by leaves whose contents bits meet mask, carrying on from trace (Q1BSP_RecursiveHullCheck).

choose(hulls, force, mins, maxs)

The hull a box of mins..maxs moves through, and what to take from a point of the box's to place it in that hull. force, from 1, names a hull to use when it is there; otherwise the box's width and height choose: under 3 wide the point hull, up to 32.1 wide hull 3 when under 54.1 high or else hull 1, wider hull 2, each falling back to a smaller hull that is there.

trace(hulls, force, axes, start, stop, mins, maxs, mask)

A box of mins..maxs moved from start to stop through a brush model's hulls, both points in the model's space before it is turned by axes (rows forward, left, up). force is as choose/4 takes it. The end and normal come back in that same unturned space.