What I need is a small, simple geometry library with shapes and intersection. I googled it, and nothing useful came up.
Anyone know of one?
What I need is a small, simple geometry library with shapes and intersection. I googled it, and nothing useful came up.
Anyone know of one?
what for?
Its better just to do it yourself, honestly. If you’re having trouble with collision detection, thats a whole other issue, but a basic geometry library isn’t hard to create, just tedious.
Edit: I found this:
http://tsusiatsoftware.net
I dunno, maybe it make sense for you to use Box2D wrapped by libGDX. Check it out anyway.
http://www.vividsolutions.com/jts/JTSHome.htm
I haven’t used it personally, but it is quite robust, mature and it works in pure Java which is also a plus.
Yes, but we all know box2D is a full out physics library, which is not what he needs. A simple class that creates geometry based on coordinates that are passed in should be more than sufficient. I don’t see the need to overkill it with box2D, not that its a bad library, its actually very good.
Hi,
I had the same problem and tried to make one: straightedge (https://code.google.com/p/straightedge/). It’s on google code and you can download the source. You would be most interested in the KPolygon and KPoint classes. They contain most of the useful geometry methods.
For more advanced geometry stuff, try JTS. It’s more advanced than my library, but not made for speed.
Cheers,
Keith
What is wrong with the ones in java? You said you looked online but never looked at java? Java has everything you want. Make a polygon and test other polygons against it.
I would NOT write your own. They are simple but hard to make fast. CommanderKeiths like is good. Use that lib.
It’s a discussion forum, people are discussing. You don’t get to end a thread, even if you started it.
libgdx has a Rectangle, etc class. There is an Intersector class and most if it would be easily ported for use anywhere.