use-revolution digest, Vol 1 #1215 - 9 msgs

Malte Brill malte.brill at t-online.de
Wed Mar 19 09:06:01 EST 2003


Jim wrote:

>Malte,

>I think I have  a better understanding of what you are trying to
>achieve. I don't think it is particularly valuable to calculate
>areas. In collision detection you need to know whether there are
>overlapping interior points of the two areas. This is rather complex
>for arbitrarily shaped polygons. Could you  settle for making each
>sprite a circle, perhaps of differing diameters? In this way you
>would only need to determine whether their centers were closer than
>the sum of  the radii, a very simple task. The radii could be custom
>properties of the sprites.

>Jim

Sorrowly my objejcts are (or at last will be) more complex than circles.
For circle-circle/circle-wall collisions I check the distance using:

sqrt((obj1.x-obj2.x)^2+(obj1.y-obj2.y)^2)

I thought if I would have the area of the two polygons and their union is
smaller than their sum, the polys must have collided (in 2D Space). Am I
wrong here?

Thanks for your support,

Malte





More information about the use-livecode mailing list