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. 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.