How to make collision detection more accurate

My collision detection works but I don’t know how to make it more accurate. I know what the problem is but I don’t know how to fix it.
When you create an image it’s out of a square canvas, so that’s what my collision detection detects (when the two images cross). I want it so only the picture part is being detected. For example, right now when my two rock images collide and bounce off, there is space between the images, the two rocks don’t even touch. [import]uid: 8335 topic_id: 12425 reply_id: 312425[/import]

You could render your rock images with no empty space, but what if you had complex shapes, like hamburgers, hot dogs, and cokes?

:slight_smile:

http://www.youtube.com/watch?v=EZT1lrxVut4

Seriously, Physics Editor is dirt cheap for what it does for you. $20 USD, and well worth it. And no, I don’t make any money from it.

[import]uid: 58455 topic_id: 12425 reply_id: 45338[/import]

You need to change the size of the bodies.

[lua]physics.setDrawMode ( “hybrid” )[/lua]

Put that in and you will see the bodies.

Try setting a radius to them that’s smaller than it is now, it should fix the issue :slight_smile: [import]uid: 52491 topic_id: 12425 reply_id: 45422[/import]

Peach is right - for round shapes that is the easiest way. If you have an object with an odd shape, however, I’d suggest the Physics Editor. [import]uid: 58455 topic_id: 12425 reply_id: 45432[/import]

Ok, I think I will just get physics editor because I have some pretty odd shaped rocks and other images. (: [import]uid: 8335 topic_id: 12425 reply_id: 45455[/import]