five-on-it / apps/tools/src/models
apps/tools/src/models
The vehicle models and the simulation's colliders. apps/client/public/models/vehicles.glb (modelled by assets/blender/models/vehicles.py) holds one top-level node per vehicle class, named by the class, its body as the mesh and its wheels as children; the convex hull of the body and of its wheels' parts above the body's lowest point (open wheels, a bike's front wheel) is the class's chassis collider, so it wraps what is drawn; below that point the wheels are the suspension's ray casts. A boat's rigging (<class>-rigging: a mast, a funnel, the swan's neck) and a car's steering wheel are drawn but never part of the hull. npm run models:hulls writes those vertices, in the game's frame, to packages/sim/src/vehicle-hulls.json, and the seat empties under each body (<class>-seat-<n>, where a seated character's hips go, and the doorway each is reached by) with the doorways their doors close (<class>-door-<tag>) to packages/sim/src/vehicle-seats.json, which the simulation gets people in and out by; npm run models:check (in validate and CI) fails when either file is not what the model gives, so the collider, the doors and the picture cannot drift apart. The devices' models (props.glb, assets/blender/models/props.py: one top-level node per device kind, a device and a collider extra) give the devices' colliders the same way: the convex hull of every vertex of a device whose collider is hull, written to packages/sim/src/prop-hulls.json, one point a line.