-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Please, before submitting a new issue verify and check:
- I tested it on latest raylib version from master branch
- I checked there is no similar issue already reported
- I checked the documentation on the wiki
- My code has no errors or misuse of raylib
Issue description
The "CheckCollisionPointPoly" function gives me a false positive when I check that two instances of squares form by 4 vertices are colliding particulary when one vertex is inside the other. I have noticed that it happens only when I reach the same or lower "Y" coordinate from the right side or when I surround it in clockwise direction. See the videos below for more clarity.
Environment
Windows 11 x64, OpenGL 3.3, AMD Radeon RX 6600
Issue Screenshot
https://github.com/raysan5/raylib/assets/38075437/bce679e1-ada7-4467-b86b-4292ba58c5fe
Code Example
int main()
{
std::vector<Vector2> vertices_b = {
{ 668.678406, 60.9284592 },
{ 629.318420, 53.7983131 },
{ 622.188721, 93.1581116 },
{ 661.548462, 100.287857 }
};
// Colliding: 1
std::cout << "Colliding: " << CheckCollisionPointPoly({ 100, 100 }, (Vector2*)vertices_b.data(), vertices_b.size()) << '\n';
}
Metadata
Metadata
Assignees
Labels
No labels