Latertater / jbox2d

Automatically exported from code.google.com/p/jbox2d
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Implement Bayazit Polygon Decomposition Algorithm #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This might get shot down quickly, seeing as jbox2d only aims to be a direct 
port of the C library called box2d. However, it would still be cool to see the 
Bayazit algorithm implemented right into the project. I.e. when you pass in a 
polygon into a fixturedef, it would take the necessary steps to check whether 
not the polygon needs to be decomposed. This would allow the infamous >5 vertex 
and/or concave polygon to be used.

I am currently doing this already in my game. It works beautifully (unless my 
polygon is more granular than the epsilon value, of course). There is no 
clipping like Bayazit clipping, and triangulation (what people usually use) is 
an expensive/laggy/unoptimized solution.

Original issue reported on code.google.com by dmitri.p...@gmail.com on 5 May 2013 at 10:52

GoogleCodeExporter commented 9 years ago
Sounds cool, do you have a patch?

Original comment by danielmu...@gmail.com on 6 May 2013 at 5:19

GoogleCodeExporter commented 9 years ago
Unfortunately my decomposition implementation is outside of JBox2d. I try to 
work without modifying the library itself :/ I also have no fail-safe checks. 
If the polygon is too granular, the stack overflows, since the decomposition is 
recursive.

Original comment by dmitri.p...@gmail.com on 7 May 2013 at 12:18