Mail Archives: djgpp/1997/04/29/01:09:25
Peter Monks wrote:
>
> Actually, you can skip the square root operation by just comparing the
> distances *squared* between objects, rather than the actual distance. I
> think this makes this approach even faster than the bounding box method.
> Don't quote me in this, however, since I haven't actually tested whether its
> faster or not!
>
> Note that this approach still isn't pixel-accurate, but if your sprites are
> generally circular, it will yield better results than bounding box detection.
Of course, you can also use the bounding circle algorithm to see if
sprites are in _proximity_ to one another, and only then run a bit by
bit comarison. Saves time and maximizes accuracy. ;)
--
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------
- Raw text -