This project is a minimal 2D rigid-disc simulator with support for multiple collision handling models. Currently only the penalty model is implemented; other models are scaffolded.
Run the main script:
python main.py
Command-line Arguments: --model : collision model to use (penalty, constraint, energy) --num : number of discs --dt : time step (seconds) --substeps : number of sub-steps per frame --e : restitution coefficient (0–1)
Arrow keys : Apply force to selected ball (hold to apply continuously)
TAB : Select next ball
SHIFT+TAB : Select previous ball
m : Cycle collision model (penalty -> constraint -> energy)
+ / - : Add / remove a ball
g : Toggle gravity
SPACE : Zero velocities of all balls
r : Reset to a random initial state
q / ESC : Quit simulation
- all 3 model is fully implemented in this version.
- Penalty-based collision model
- Constraint-based collision model (impulse/LCP)
- Energy-based collision model (potential methods)