Date: Tue, 30 Sep 1997 23:12:46 -0500 (CDT) From: Andrew Deren To: djgpp Subject: collision detection Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Does anyone know how to detect if two rectangles overlap each other at some point. Let's say we have something like this: typedef struct RECT { int x1, y1, x2, y2; } RECT; and I need a function that would take 2 of those and check if they overlap. I got it working partailly by checking the corners of one rectangle if they are inside the other, but if the other is smaller and is completly enclosed in the first it does not work. Any help would be appreciated. Thanks. ,,, (0 0) +-------------oOO----(_)-------------------+ | Andrew Deren | | aderen AT eecs DOT uic DOT edu | | www.eecs.uic.edu/~aderen/ader/main.html | +-------------------------oOO--------------+ || || ooO Ooo