distance < range + sum_of_radii
distance^2 < range^2 + 2*range*sum_of_radii + sum_of_radii^2
You should be able to precompute everything on the right-hand side and then the check again becomes distance^2 < constant. So no square root needed.
Show differencesHistory of post edits
#2alvaro
Posted 06 April 2012 - 01:12 PM
distance < range + sum_of_radii
distance^2 < range^2 + 2*range*sum_of_radii + sum_of_radii^2
You should be able to precompute everything on the right-hand block and then the check again becomes distance^2 < constant. So no square root needed.
distance^2 < range^2 + 2*range*sum_of_radii + sum_of_radii^2
You should be able to precompute everything on the right-hand block and then the check again becomes distance^2 < constant. So no square root needed.
#1alvaro
Posted 06 April 2012 - 01:12 PM
distance < range + sum_of_radii)
distance^2 < range^2 + 2*range*sum_of_radii + sum_of_radii^2
You should be able to precompute everything on the right-hand block and then the check again becomes distance^2 < constant. So no square root needed.
distance^2 < range^2 + 2*range*sum_of_radii + sum_of_radii^2
You should be able to precompute everything on the right-hand block and then the check again becomes distance^2 < constant. So no square root needed.