Simulation - Spheres in Collision

Path of the code: [07_sphere_collision]
This scene models a set of particles representing spheres falling under gravity. Each particle is associated to the following parameters: position \(p\), speed \(v\), forces \(f\), as well as radius and color.
The position and speed of each particle is updated through time thanks to a discrete integration


At the current state of the program, only gravity is took into account.
Note that when multiple spheres are involved in stack, the multiple collisions cannot be solved only by a single pair-wise correction. This can lead to jittering behavior. To limit such effect you can

Possible extension