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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post 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?
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

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

Post by rude »

This function exists in Box2D, but looks like I forgot to wrap it.

Lame.
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post by Kuromeku »

Please do it for the next version Rude! :D

<3
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

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

Post by rude »

Will do!

On the plus side, the release is almost ready.
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post by Kuromeku »

Awesomesauce ^_^
User avatar
conman420
Prole
Posts: 33
Joined: Sun Aug 31, 2008 8:46 pm

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

Post 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?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot] and 6 guests