Luckily you uploaded your solution, because the problem isn't in the function at all.
Code: Select all
std::uniform_real_distribution<float> distOuter(10.0f, 100.0f);
std::uniform_real_distribution<float> distInner(5.0f, 50.0f);
I originally thought that this was the problem, since there is overlap between the largest inner and smallest outer radii and you only check for outerRadius when checking for overlap. However, even after swapping them if outer < inner, there's still overlap. I wasn't able to find the problem.
I translated all the points of each star and tested for collision and it found collisions with the points of the stars, but when testing distance between the stars against the sum of the radii, no collisions were found.
Sorry I don't have a solution for you. The only thing I can think that would cause the issue is something in the transformation.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com