tvarnish / alevel-sombrero

Sombrero is my A-Level Computer Science project focusing on the simulation of the N-Body Problem [Archive]
0 stars 0 forks source link

Simulation with only two bodies (colliding) causes segmentation fault [22 Dec 2016] #8

Closed tvarnish closed 6 years ago

tvarnish commented 6 years ago

If a simulation is set up with only two bodies on a head-on collision path with each other, a segmentation fault occurs when they are supposed to collide.

This may be due to having an empty list when the two bodies are removed from the linked list and a new "combined" body is added.

Initially opened on 22 December 2016

tvarnish commented 6 years ago

I believe that this was caused due to a problem in my List::Remove(int id) function (i.e. I had written it incorrectly). This then caused an issue (or at least made me aware of it) with the collision physics, and bodies began to move in weird directions once they had combined.

This new issue has now been fixed, although to be honest, I'm not quite sure how!

Initially commented and closed on 22 December 2016