in this video we see how to abstract the gravitational attraction formula into a function, so that we can then use it with multiple attractors without having to re-write it every time.
We also see how to create a "struct" in GLSL and use it to pass the attractor's parameters as arguments to the function.
We then see how to make the particles bounce from the edges of our virtual cube.
Hope you like it!
For questions I'm here.