SFML community forums
Help => Graphics => Topic started by: ankitpaudel20 on February 08, 2020, 09:18:36 am
-
i want to check for collision detection of rectangle but didn't find a way to check if the point is inside the rectangle so any ideas?
-
sf::Rect<T>::contains()
Also you probably can find a few hundred responses by googling "rectangle point collision detection sfml" ;)
-
Isn't that for rectangle whose sides are aligned with axes?
I meant to ask if it had rotations and other transformations applied ?
-
Then you can apply the inverse transform of the rectangle to the point, so you're back into a coordinate system where the rectangle is aligned with axes.
Or you can use one of the algorithms which works with any convex shape (Google them).