liabru/matter-js

Physics simulation going wrong

sampov2 opened this issue · 0 comments

I'm building a data visualization using matter-js and I ran into a weird issue. The simulation is based on open street map road sections that are converted into chains of circles (node) using Composites. A node can be part of multiple chains. Only nodes that are part of road sections are included in the simulation.

The simulation starts as expected. However, as the simulation progresses it seems some nodes detach from the chains and after a few more seconds, the chains start oscillating wildly and start tensioning the chains tighter and tighter. It seems as if something is increasingly adding force to the simulation.

Attached is a video a video showing what happens.

The code along with the example data can be found on this branch: https://github.com/sampov2/road-spider/tree/matterjs-going-wild

Any ideas on what is going wrong? Or am I doing something incorrectly: Perhaps chains should not include static bodies? Perhaps a body should not be part of multiple chains?