PDA

View Full Version : PollyColly for Pascal



jdarling
15-02-2007, 04:48 PM
I've been working with Polygon Collision for a few days now. After looking at pollycolly (a C library for Polygon Collision) and its implementation in Project Phoenix, I came up with a decent generic library for polygon, rectangle, and circle collision. Actually, its more of a joining of all of the units of Phoenix with some modifications to make a common number type available in a single unit. Anyways, I'm posting it here in case anyone else needs this type of thing.

Download:
http://www.eonclash.com/Lazarus/pollycolly.zip

Traveler
16-02-2007, 12:25 PM
Sounds nice! I'll be sure to have a look at them.

Andreaz
14-05-2007, 09:13 PM
Acually didn't notice this thread before, good work there.

I'm in the process of rewriting this code through, there's a bug in it that can make the seperation of the objects occuring in the wrong axis (same problem exists in Oliver's code). Currently there's support for all kinds of collisions between AABB's, circles and polygons (including Polygon <> Circle and so forth). It will also support rotating polygons (Circles and AABB's doesnt make any sence of rotating)

Working on finishing the last parts of the responces for some of the collisions, it's as a bonus a bit faster then the last version aswell, and that's no bad thing

JernejL
14-05-2007, 09:17 PM
Actually, on oliver's website, there is a delphi / pascal code example.

jdarling
15-05-2007, 01:37 PM
@Andreaz - Can't wait to see the final version with everything fixed in it. I've noticed the bug in a few of the demos I've been working on for JumpStart. Its one of the reasons I don't allow for Circle/Poly/Rect intersection testing right now. I found a work around but it doesn't always work, and my math skills are a bit rusty to find the real fix.

@Delphi - Odd, didn't see that there when I went to his site. Oh well, duplication of work isn't always a bad thing.

JernejL
15-05-2007, 01:49 PM
@Delphi - Odd, didn't see that there when I went to his site. Oh well, duplication of work isn't always a bad thing.

Well, i paid some coder 40どィ to translate it to pascal, but later never used it.

Andreaz
15-05-2007, 02:46 PM
@Delphi - Odd, didn't see that there when I went to his site. Oh well, duplication of work isn't always a bad thing.

Well, i paid some coder 40どィ to translate it to pascal, but later never used it.
40どィ, dam i would do it for half and still buy you a beer ;) But then i'm kind of an open source kind of person ;)

NecroDOME
15-05-2007, 03:26 PM
is it 3D or only 3D?

Andreaz
15-05-2007, 03:35 PM
It's 2D, as Phoenix is a 2D library, i have no plans of doing a 3D version of it either, i can only recomend a physics engine for that, like TrueAxis as i've used myself.

JernejL
15-05-2007, 03:40 PM
@Delphi - Odd, didn't see that there when I went to his site. Oh well, duplication of work isn't always a bad thing.

Well, i paid some coder 40どィ to translate it to pascal, but later never used it.
40どィ, dam i would do it for half and still buy you a beer ;) But then i'm kind of an open source kind of person ;)

Well, you can always try translating this ;)
http://www.pascalgamedevelopment.com/viewtopic.php?p=33721&highlight=#33721

Andreaz
16-05-2007, 05:32 AM
Well, you can always try translating this ;)
http://www.pascalgamedevelopment.com/viewtopic.php?p=33721&highlight=#33721

I'm not that friendly with matrixes throug, havn't really got the grip of em, vectors are alot easier...

Managed to get most things working it seems, what's left is the collision points for the Polygon<Polygon>AABB, but they are quite tricky....

http://phoenixlib.net/files/Collisions.zip