What it does
hullOfVerts(verts, maxPoints?) is the one to call on a model. It reads the engine's vertex format, merges positions
that sit on the same spot, and runs quickhull over what is left. If the hull still has more points than the budget (48
by default), it samples them down by greedy farthest-point selection: it starts with the point furthest from the
centre and keeps adding the point furthest from everything chosen so far. The survivors are the ones that hold the
shape's extent, where simply taking the first few would keep one end of the model and lose the rest.
quickhull(points) takes any cloud of xyz points and returns the hull's vertices. Degenerate clouds come back rather
than throwing: a line returns its two ends, and a flat sheet returns its outline, so a square sheet gives four corners.
Its tolerances scale with the cloud's size, so the same model imported in centimetres or in kilometres produces the
same collider.
Features
- Model hulls —
hullOfVertsover any mesh in the engine's vertex format, loaded or built in code. - A point budget —
maxPointsper model, with farthest-point sampling to keep the shape. - Any point cloud —
quickhullon flat xyz triples. - Degenerate inputs handled — points, lines and flat sheets return their extreme points.
- Scale-independent — tolerances relative to the model's size.
- Pure and deterministic — plain exports too, so a build step or a test can call them without a game.
Good for
- Physics games with loaded props — rocks, barrels, ramps and debris that tumble and stack like their shapes.
- Vehicles and ships whose collider should follow the body rather than a box.
- Physics puzzles with irregular pieces to drop, push or balance.
- Build steps that precompute colliders for a set of models.
Make it yours
The pack has no options. The one dial is hullOfVerts's maxPoints, which is chosen per model: a low budget for a
pebble that only needs to roll, a higher one for a sculpted ramp a car drives over. Use it at load on models from a
file, or on meshes your game builds in code, and pass the result to physics-3d as a hull shape.
Works with
physics-3d— takes the result as a hull collider, and falls back to the object's own box for a hull too thin to use.model-files-3d— the loaded OBJ and GLB models that need a hull.geometry-3d— procedural meshes in the same vertex format.
Good to know
- A hull is convex: a doughnut's hull is a solid disc and a room's is a solid block. Build shapes with holes from several bodies.
- It is written for clarity rather than speed and belongs at load, never in a frame.
- Skip it when every body is a box, a sphere or a capsule; those come straight from the object's size.






