Simulation - Spheres in Collision

Path of the code: [02_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 using a discrete integration in the file simulation/simulation.cpp
In the current state of the program, only the gravity is taken into account. But the collision with the cube boundaries and between the sphere need to be implemented.

Collisions

Add the collision detection and response between the spheres and boundary faces of the cube using impulse based response on the sphere velocities.
The collision response can be implemented in two steps: Once the velocity is computed, then the sphere positions are finally updated
Note: You may perform several iterations of the numerical integration at each frame in order to speed up the simulation, while keeping a constant (or smaller) time step.

Possible extension