POOL PHYSICS SIMULATOR

This project combines physically-based collision resolution and next event estimation for pool.
Information about the game state is used to predict the next event. An event could be:
  • Ball-ball collision
  • Ball-wall collision
  • Change of motion state

The different motion states of a ball are sliding, rolling, spinning and stationary. Different states can be created based on how and where the cue hits the ball (as seen in the image below).
The time step length can be set by the user; it is the smallest unit of time, i.e. the time between 2 frames. Multiple events could take place within a single time step.

Algorithm:
1. Apply forward Euler for the current time step.
2. Determine all events within that time step.
3. Pick the first event (with minimum t).
4. If there is an event:
       A. Apply Euler backwards. Roll back to the exact time the event happened.
       B. Resolve collision.
       C. Go to step 1 of the algorithm with the rest of the time frame.
5. Update accelerations and velocities.