Collision
| Source guide | Project README |
Builds and queries collision geometry for movement and spatial intersection. Mesh colliders cache triangles and a spatial grid; callers use these queries for walker and traffic interactions.
Spatial queries
flowchart LR
Mesh["Mesh geometry + world transform"] --> Cache["Cached triangles + grid"]
Walker["Walker body / movement"] --> Query["Collision query"]
Cache --> Query
Traffic["Current traffic bounds"] --> Query
Query --> Move["Stop / slide / find clear position"]
insideWalker.js excludes terrain and checks body heights. This tests current traffic positions; traffic does not steer around the walker. Picking resolves pointer hits instead.
- collider.js: build or reuse a mesh collider.
- insideWalker.js: test the walker’s surroundings.
- indexTriangle.js: index a triangle into grid cells.