Generate a bunch of box2d bodies to match a grid backed by ndarray-continuous.
The demo still needs some tweaking/optimisation work but you can find it here. It also shares a lot of code with the topdown-physics demo.
npm install continuous-box2dPass Box2D to the module to get back a continuous-box2d.
Generates and removes bodies to world as chunks are added/removed to the
continuous ndarray field. Takes the following options:
data: A callback to modify theuserDatathat gets attached to each body.xscale: the horizontal scale of the grid, in cell units to box2d units. Defaults to 1.yscale: the vertical scale of the grid. Defaults to 1.