Original Post
Hi
So normally a distance check would be done by simply doing distance < range check. So lets say distance between character a from character b.
However to optimize one would do d^2 < r^2 check.
However if one has to include the radius of each of the characters then the check would be
distance - characterradii < range where characterradii = raidusofa + radiusofb
I'm trying to think of some way where I could keep the squared optimization and also be able to include the radii part.
Thoughts??
I'm discounting this one
(d^2 - r^2)/(d+r)
as that will need the square root value of d
Thanks.
So normally a distance check would be done by simply doing distance < range check. So lets say distance between character a from character b.
However to optimize one would do d^2 < r^2 check.
However if one has to include the radius of each of the characters then the check would be
distance - characterradii < range where characterradii = raidusofa + radiusofb
I'm trying to think of some way where I could keep the squared optimization and also be able to include the radii part.
Thoughts??
I'm discounting this one
(d^2 - r^2)/(d+r)
as that will need the square root value of d
Thanks.