View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

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.

Related: walk, picking, traffic.