After playing around with the fantastic simulator for a whole week...... I found 10+ ways of playing the simulations!
However every time I restart, I need to manually readjust the bars to the right config, which I screenshoted with my phone's camera.
If only the app could save the configs ... save into something like JSON or YAML (I'm not very familiar with Java practices)
And then we could even share them with more convenience!
The number of particles is not a "physics setting" and should therefore not be included in the "PhysicsSettings" class.
Furthermore, the number of particles should only be stored implicitly as the length of the particles array.
That means, that the current logic of "first changing settings.n, then adapting the length of the particles array accordingly" is not really good design. Instead, there should be explicit methods for changing the size of the particle array.
Instead, only have one field dt that is changed whenever needed.
The existing fields autoDt, fallbackDt and maxDt and their corresponding logic should still exists somewhere else, but not here.
Best solution is probably to extract that whole asynchronous looping to a class that only takes care of this and wraps the Physics class.
So there will exists the regular "Physics" class, but without the asynchronous looping functionality, and a new "AsyncPhysics" class that contains the asynchronous looping functionality and acts as a wrapper around the "Physics" class.