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.

The pack

hull3d

function hull3d(): Pack<{ hull3d: Hull3dApi }>

The hull-3d pack: a convex wrap of any point cloud or loaded model, for a physics collider. Pure maths, so it needs no backend and runs headless.

Helpers

hullOfVerts

function hullOfVerts(verts: Float32Array, maxPoints: number = 48): Float32Array

Convex hull of a stride-8 vertex soup (pos+normal+uv — the engine's geometry format): dedupes positions (1e-5 grid), runs quickhull, and if the hull has more than maxPoints vertices, SIMPLIFIES by greedy farthest-point sampling down to maxPoints (physics cores want small hulls; 32–64 is plenty).

Functions

quickhull

function quickhull(points: Float32Array | number[]): Float32Array

3D quickhull over a point cloud. Input: flat xyz triples. Output: the hull's unique vertices as flat xyz triples (order unspecified). Handles degenerate inputs by returning what it can (≤3 points / coplanar sets return the input's unique extreme points — Box3D accepts them).

Types

Hull3dApi

type Hull3dApi = typeof kit

game.hull3d — every function this pack carries, as one namespace.