From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Collision Detection Date: Mon, 28 Apr 1997 10:58:11 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 24 Message-ID: <336482C3.6092@SPAMcs.com> References: <5k3lbt$2es_002 AT fmsc DOT com DOT au> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp103.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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 -----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------