News for hackers. Stuff that matters.
Re:How I implemented 2D collision detection in Pistol Slut by thebooktocome on Wednesday January 19, 2011 @10:21AM (#2119948)
There's no need to take square roots. sqrt(x) is monotone increasing, so comparing squared-distances is equivalent to comparing distances.
Re:How I implemented 2D collision detection in Pistol Slut by Retric on Wednesday January 19, 2011 @06:46PM (#2121812)
If all you want is distance between points (x1-x2)^2+(y1-y2)^2+(z1-z2)^2 = dist^2 works.

However, in games you frequently want to check the intersection of lines, or spheres with plains, cubes etc. And for those equations you often have to deal with the inverse square root function.

PS: Anyway, my point was more abut the process. First you try A, which culls 90% of your objects, then you try B which culls 95% of the objects then you do the full and actuate solution if you have time. http://en.wikipedia.org/wiki/Ragdoll_physics takes a lot of CPU time, and now days games need to be even more realistic.