Log inGet started
Package

crashCars.package

This package holds more than this page lists. See all of its files in its world.

README.md

crashCars tests

Regression suite for the crashCars package. It checks API behaviour and invariants, never exact tuning numbers, so retuning the crash physics does not break it:

  • Catalog: Cars.catalog() has the nine models (city, hatch, saloon, estate, suv, pickup, coupe, mpv, classic60s) with positive sizes and mass; Cars.looks() has realistic, toy and lowpoly; unknown ids answer nil.
  • Assets: every model × look × part mesh (shell, bumper, bonnet, glass, interior: 135) resolves through Cars.mesh, each look's wheel mesh resolves, and every material resolves through Cars.material.
  • Geometry (Cars.derive): the front is ahead of the rear (forward is −Z), both axles sit inside the body a wheelbase apart, and the firewall, steering wheel, driver and rear seats sit in order inside the cabin, within the body's width and between sill and roof.
  • Structure: Cars.structure gives positive crush travel per face and a rising g law; Cars.crushForce rises with depth on every face, past bottom-out too, and is never negative.
  • Seats: Cars.seatLayout has driver and passenger everywhere, rear seats on all but the pickup, and every seat back, head restraint and wheel hub pad faces its occupant with the rigid frame behind the foam.
  • In play: a local hatchback spawned at a private site (x = −1200) becomes ready, reads zero front crush at rest, and Cars.despawn leaves none of its entities behind. The test enters play itself when run from edit and leaves it (discarding play changes) when it ends.

It leaves crash outcomes (crush depths at given speeds, g levels, panels coming off) to crashRig.

Run it in edit mode: zero tests run crashCars, or tools.use("tests", "run", "crashCars").