Collision is baked for each cell and attached in microseconds
Collision for a cell is one Box3D compound, baked offline. At run time it is loaded from bytes and checked on a worker thread, then attached on the physics thread as one body in one step.
| 1,000 instances | 3,000 | 10,000 | |
|---|---|---|---|
| Compound: children, size | 126, 102 KiB | 376, 296 KiB | 1,251, 976 KiB |
| Check on a worker | 3 µs | 5 to 7 µs | 32 to 41 µs |
| Attach, mean / longest | 2 to 3 µs / 26 µs | 3 to 5 µs / 27 µs | 5 to 6 µs / 25 µs |
| Detach, mean / longest | 1 µs / 6 µs | 1 to 2 µs / 6 µs | 2 µs / 11 µs |
Attaching does not grow with what is in the cell. In the test, 200 balls were dropped on each cell while cells came and went; none went through the ground. In the largest cell two rolled off the edge in ten seconds, which the test now tells apart from falling through.
One caution about our own numbers: the physics step timings taken alongside were measured in an order that makes them unreliable, so they are not quoted here. The attach and detach times are direct.
On disk, a baked Box3D triangle costs 43 bytes and a box about 108. That turned out to matter more than expected: see the measured cell of suburb.
Never tried under a car. The test cells are 128 ground triangles and boxes; a cell of real triangle meshes is larger and was not attached in this test.