Closed kevinoleary19 closed 2 years ago
please also provide the code for circle points and radius and scale will reproduce and tell you what i think
@koleary94
also try version 3+ and see if you get same error thanks
@koleary94 assuming this works now after version 3+
closing the issue and feel free to reopen if you have more comments, or if I misunderstood something
Thanks for your work on maintaining this package!
Running into a bit of a weird issue. Hopefully I'm missing something simple.
I've created a system where I am collision testing between a circle and different polygons. I've noticed that only the first set of points that I pass into the polygon are being 'collided' with by the circle. Here is a visual example of my data drawn through the canvas functionality provided by the library.
In the image above, I'm passing in 3 points to the
createPolygon
method:If I swap the first two coordinate pairs in the list, thus making the overlapping side the 'first' line of the polygon, the system correctly identifies the collision.
Also, If I remove one of the edges such that the polygon is now a line, it correctly identifies the collision, illustrated by the image below
For each of the above changes I made, the bounding volume hierarchy is correctly identifying that this polygon is a
potential
, so that part of the system is fine for me.This originally was happening to me with 4 sided polygons and though it may be related the shapes being concave, but I created the test triangle above to eliminate that as a cause.
Is it potentially that I am not passing in an x or y coordinate to the polygon? I'm using typescript and the type definitions mark those args as optional, so I was thinking that was not the cause either but could be wrong.
Any help would be much appreciated!