Phaser AE

3D Convex Hulls

Free packv3.0.0-23DLogic

A loaded model is an arbitrary triangle soup; a 3D physics solver wants a small convex wrap of it. This pack turns one into the other, so a rock, a ramp or a chamfered crate collides like itself rather than like its bounding box.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 19, 2026

3D Convex Hulls: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

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 — hullOfVerts over any mesh in the engine's vertex format, loaded or built in code.
  • A point budget — maxPoints per model, with farthest-point sampling to keep the shape.
  • Any point cloud — quickhull on 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.

More Logic packs

Show all →