SFML community forums

Help => General => Topic started by: ohgodmanyo on June 28, 2021, 05:22:52 pm

Title: Help with pixel perfect collision on convex shapes.
Post by: ohgodmanyo on June 28, 2021, 05:22:52 pm
When I use the intersects() function, it only uses the hitboxes as a rectangle i think and it isn't accurate enough. I have already heard of flood fill and all of that, but I am struggling with implementing it. I would appreciate if someone could just put the code down there to help me get perfect pixel collisions on convex polygons.
Title: Re: Help with pixel perfect collision on convex shapes.
Post by: eXpl0it3r on June 30, 2021, 02:24:35 pm
Pixel Perfect collision detection is pretty much always overkill, plus it won't help you with implementing the reaction steps after the collision.

But you can find such (and other) implementation here: https://github.com/SFML/SFML/wiki/Source%3A-Simple-Collision-Detection-for-SFML-2