Page 1 of 1

Um, finding out if a line "hits" any shape.

Posted: Mon Sep 08, 2008 4:58 am
by Kuromeku
I need to find out if a line, with start position and end position specified, hits any shape and what position it hits it at.

I know I could use polygonShape:testPoint(x, y); but that would mean I'd have to test every position on the line, which could be bad as you can imagine. Any ideas?

Any ideas?

Re: Um, finding out if a line "hits" any shape.

Posted: Mon Sep 08, 2008 7:42 am
by rude
This function exists in Box2D, but looks like I forgot to wrap it.

Lame.

Re: Um, finding out if a line "hits" any shape.

Posted: Mon Sep 08, 2008 10:35 am
by Kuromeku
Please do it for the next version Rude! :D

<3

Re: Um, finding out if a line "hits" any shape.

Posted: Mon Sep 08, 2008 10:44 am
by rude
Will do!

On the plus side, the release is almost ready.

Re: Um, finding out if a line "hits" any shape.

Posted: Mon Sep 08, 2008 11:15 am
by Kuromeku
Awesomesauce ^_^

Re: Um, finding out if a line "hits" any shape.

Posted: Mon Sep 08, 2008 4:15 pm
by conman420
rude wrote:Will do!

On the plus side, the release is almost ready.
Are you ever going to add joint:Remove() body:Remove() etc?

I know about the collect garbage thing but it would be nice to have them, they work if used correctly no?