www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/30/19:39:57

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Collision Detection
Date: 30 Apr 1997 19:03:23 GMT
Organization: Oxford University, England
Lines: 23
Message-ID: <5k851r$6hc@news.ox.ac.uk>
References: <MPG DOT dcddb78f470c89c98968a AT news DOT demon DOT co DOT uk> <Pine DOT SV4 DOT 3 DOT 94 DOT 970428125700 DOT 28102C-100000 AT aludra DOT usc DOT edu> <5k75ea$j15 AT news DOT ox DOT ac DOT uk> <Pine DOT SV4 DOT 3 DOT 94 DOT 970430112659 DOT 17180D-100000 AT aludra DOT usc DOT edu>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

rellwood (rellwood AT aludra DOT usc DOT edu) wrote:
: On 30 Apr 1997, George Foot wrote:

: > rellwood (rellwood AT aludra DOT usc DOT edu) wrote:
: > 
: > : The best method is the slowest, and that is to AND each nonzero pixel in
: > : sprite A with each nonzero pixel in sprite B.  If any of the ANDs return
: > 
: > I think you mean OR.

: No I meant AND.  If OR was used, the function would return a true if it
: encountered a pixel from sprite A *OR* sprite B in a given location, which
: is not necesarially a collision.  If AND was used it would only return
: true if it encountered a pixel from sprite A *AND* sprite B in a given
: location, which always signifies a collision between the two sprites.

Oops, my (partial) mistake. My line of thinking was that if pixelA==1 and
pixelB==2 then (pixelA&pixelB)==0; what I should have said was logical AND
not bitwise AND, i.e. (pixelA&&pixelB)==TRUE in this case.

-- 
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019