I'm trying to implement collision detection for rotated rectangles. I found the following for SFML 1.6:
The points in local coordinates are:
- (0, 0)
- (0, sprite.GetSubRect().GetHeight())
- (sprite.GetSubRect().GetWidth(), 0)
- (sprite.GetSubRect().GetWidth(), sprite.GetSubRect().GetHeight())
The points in global coordinates are:
- sprite.TransformToGlobal(px)
where px is one of the local points.
How do I get the local coordinates in SFML 2? Via getLocalBounds() or via getTextureRect()?
Edit: An additional question just came to my mind. Does changing the origin of a sprite change the way I have to calculate those local coordinates?