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
- - \(v^{k+1} = v^{k} + \Delta t\;f^{k}\)
- - \(p^{k+1} = p^{k} + \Delta t\;v^{k+1}\)
Collisions
At the current state of the program, only gravity is took into account.- > Add collision detection and response between the spheres and the faces of the cube.
- > Add collision detection and response between the sphere themselves.
- - perform several integration steps and collision correction with smaller timer steps before displaying the result
- - avoid bouncing between colliding particles with small relative velocity
Possible extension
- Allow the user to move the box interactively.
- Speed-up the collision detection in building a spatial acceleration structure such as a regular grid storing neighboring particles.