w0rm/elm-physics

Build a pluggable debugger for physics

w0rm opened this issue · 0 comments

w0rm commented

The idea is to implement a debugger that could hook into any Elm program, grab a snapshot of elm-physics world, and open up a 3D visualiser for it in a new window, where everything is inspectable, clickable, etc. And where you can save the snapshot and examine it later.

  1. Maybe a wrapper around the Elm compiler with a special debug-physics mode that would post-process JavaScript to expose things for the physical debugger, that would be pointed at the JavaScript objects from the game using the same Elm types?
  2. Or maybe a json encoder/decoder for the physics World, so that the game could encode it, and debugger decode it — slower but could be useful for other use-cases

Because the debugger needs to expose internals, that otherwise might not be available through the public API, its code could be colocated with Elm physics code but have a different elm.json file.

https://m.youtube.com/watch?v=1RphLzpQiJY was the inspiration for this idea