[physics] Fixture:testPoint does not appear to work on Chainshapes

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
Connorses
Prole
Posts: 49
Joined: Fri Sep 06, 2013 7:02 am

[physics] Fixture:testPoint does not appear to work on Chainshapes

Post by Connorses » Tue May 10, 2016 6:48 am

The title pretty much explains it. It would appear that Fixture:testPoint does not work with fixtures with nothing besides a single chainshape in them. I'm sure I could find workarounds (such as using 'triangulate' to break it into triangles and testing those) but I'd like to know if anyone else has come across this problem, and if they have a better solution.

User avatar
ivan
Party member
Posts: 1468
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: [physics] Fixture:testPoint does not appear to work on Chainshapes

Post by ivan » Tue May 10, 2016 7:52 am

Chain shapes have 0 area so a point could never be "inside". This is because chain shapes are just collections of edges.
I suppose you could test if a point is "near" the edges of the chain.

Post Reply

Who is online

Users browsing this forum: Google [Bot], zorg and 12 guests