I'm implementing a collision system into my Level editor, I have rectangle collision all done, but I can't figure out how polygon collision could possibly work. Is this built into Love2d? Is there an module or api that does this for me? or is it easy to implement that I just haven't thought of?
help!
Polygon Collision?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Polygon Collision?
I'll just leave this here: http://love2d.org/wiki/love.physics
Also, http://vrld.github.com/HardonCollider/
Also, http://vrld.github.com/HardonCollider/
Kurosuke needs beta testers
Re: Polygon Collision?
It sounds like HardonCollider would be best suited for you. It's very easy to set up and use.
Re: Polygon Collision?
To answer more of your question, there is no existing implementation for collision other than the physics module and that only covers simple convex shapes from what I know. Anything more complex will require you to code it yourself.
A few seasoned users have done some simple libraries. Search for Fizz and HardonCollider on the wiki. Fizz isn't polygonal, but may contain code you can build from so long as you remember to credit Taehl. I know nothing of HC.
Love is a framework rather than an engine, something you can build these sort of features into through your own modules and/or libraries.
A few seasoned users have done some simple libraries. Search for Fizz and HardonCollider on the wiki. Fizz isn't polygonal, but may contain code you can build from so long as you remember to credit Taehl. I know nothing of HC.
Love is a framework rather than an engine, something you can build these sort of features into through your own modules and/or libraries.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Polygon Collision?
For shapes, love.physics (which is a wrapper around Box2D) supports circles and 8-point, convex polygons (including a helper for rectangles). If you need something more complex than that, you would use multiple shapes in association with a body.Ensayia wrote:To answer more of your question, there is no existing implementation for collision other than the physics module and that only covers simple convex shapes from what I know. Anything more complex will require you to code it yourself.
Whether you go for custom collision or the physics system depends on your needs. If you want some simple collision detection, custom is the way to go. If you want physics simulation, love.physics is most likely best.
Re: Polygon Collision?
Not true. HardonCollider does support collision between points, circles and arbitrary simple (=non intersecting) polygons, including rectangles.Ensayia wrote:To answer more of your question, there is no existing implementation for collision other than the physics module and that only covers simple convex shapes from what I know.
If you don't want to use the existing detection system, you can build your own using the shape:collidesWith() method. You can even go deeper and just use the Polygon class that provides useful things like triangulation and splitting into convex sub polygons.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Polygon Collision?
Wouldn't two colliding polygons per definition be intersecting? Or am I misunderstanding something here?vrld wrote:Not true. HardonCollider does support collision between points, circles and arbitrary simple (=non intersecting) polygons, including rectangles.Ensayia wrote:To answer more of your question, there is no existing implementation for collision other than the physics module and that only covers simple convex shapes from what I know.
Re: Polygon Collision?
I meant no existing implementation built into LOVE itself. Sorry if I confused people.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Polygon Collision?
I think he meant polygons intersecting themselves.nevon wrote:Wouldn't two colliding polygons per definition be intersecting? Or am I misunderstanding something here?
Help us help you: attach a .love.
Who is online
Users browsing this forum: Bing [Bot] and 12 guests