Annotated: main.py#
main#
Initializes Pygame, creates window, clock, and font.
Instantiates
SimulationandInputState.Frame loop:
Capture
frame_t0for profiling.Events:
handle_eventsupdates simulation state and toggles.Physics timing around
sim.step_frame(); computephysics_ms.Drawing:
Clear background; optional meter grid and field grid (timed separately).
Draw glow, trails, particles, velocity/force vectors.
Placement preview and hover tooltip.
Compute and display overlay with FPS, energies, and timings.
Flip buffers and tick at target FPS.