Builds the Rapier shape for a §24 collision shape, for the query entry points
that take a bare Shape (§30 overlap and shapeCast).
Only the convex 2D tier is reachable — circle, rectangle, capsule, convex
polygon — because the query entry points run validateQueryShape(shape, "2d") first, which refuses the 3D tags and the two composite 2D shapes
(polyline, chain; PH-22a). The 3D tags are rejected here rather than
silently promoted.
Capsule axis. Rapier's Capsule(halfHeight, radius) puts the cylindrical
section along +Y in 2D, which is exactly §24's convention — verified
against 0.19.3 by dropping a capsule onto a floor and measuring its resting
height as halfHeight + radius above the surface. No axis swap is needed.
Polygon.ConvexPolygon(vertices, skipConvexHullComputation) is built
with the hull computation on (false). @fourjs/physics already rejects a
concave outline, so the hull is a no-op on valid input; leaving it on is what
makes either winding acceptable, which PolygonShape promises and Rapier's
convexPolyline (counter-clockwise only) does not.
Builds the Rapier shape for a §24 collision shape, for the query entry points that take a bare
Shape(§30overlapandshapeCast).Only the convex 2D tier is reachable — circle, rectangle, capsule, convex polygon — because the query entry points run
validateQueryShape(shape, "2d")first, which refuses the 3D tags and the two composite 2D shapes (polyline,chain; PH-22a). The 3D tags are rejected here rather than silently promoted.Capsule axis. Rapier's
Capsule(halfHeight, radius)puts the cylindrical section along +Y in 2D, which is exactly §24's convention — verified against 0.19.3 by dropping a capsule onto a floor and measuring its resting height ashalfHeight + radiusabove the surface. No axis swap is needed.Polygon.
ConvexPolygon(vertices, skipConvexHullComputation)is built with the hull computation on (false).@fourjs/physicsalready rejects a concave outline, so the hull is a no-op on valid input; leaving it on is what makes either winding acceptable, whichPolygonShapepromises and Rapier'sconvexPolyline(counter-clockwise only) does not.