CollisionDetection icon indicating copy to clipboard operation
CollisionDetection copied to clipboard

polyPoly flawed

Open polymeris opened this issue 6 years ago • 4 comments

I haven't really looked into the details, but playing around with the online version, sometimes when the small polygon is fully inside the larger one, a collision is not detected.

Also, maybe related, you run the following code inside the for-loop, which doesn't make much sense, since it doesn't depend on any of the looped vars, only function parameters:

    // optional: check if the 2nd polygon is INSIDE the first
    collision = polyPoint(p1, p2[0].x, p2[0].y);
    if (collision) return true;

(maybe you wanted to iterate over the vertices of p2?)

polymeris avatar Nov 04 '19 16:11 polymeris

Sorry, I know this issue is super old now! I can't seem to make this happen – would you mind trying to replicate the issue and record a short video?

jeffThompson avatar Apr 20 '20 17:04 jeffThompson

I am not sure how to record a video. It seems easier to reproduce the bug on a smartphone. The polygon blinks blue as you drag the shape around.

polymeris avatar Apr 21 '20 21:04 polymeris

Didn't intend to close ticket, always hit the wrong button. (Although feel free to close if you can't repro)

polymeris avatar Apr 21 '20 21:04 polymeris

No worry! I'll take a look on my phone and see if it's a problem for me too.

jeffThompson avatar Apr 22 '20 13:04 jeffThompson