S_BISHOP
S_BISHOP

Reputation: 31

I cant seem to figure out how to both rotate and collide a Rectangle in SFML ?

Problem is, from what I can tell:

sf::FloatRect - has intersection functionality, but no rotation? sf::RectangleShape - has no intersection functionaly?, but rotation

how do you get both functionality's of the one Rectangle type shape?

Please, Once I understand how both to have a Rectangle of some sort be collidable by intersection functionality and be able to be rotated.

Scenario: Some game sprites will rotate and a collisionBounds Rectangle must mirror the sprites rotation

thanks, I really need to understand this once and for all.

Upvotes: 0

Views: 83

Answers (1)

amc176
amc176

Reputation: 1544

sf::RectangleShape has the methods getGlobalBounds() and getLocalBounds(), which return the enclosing sf::FloatRect that you should use for doing intersections.

Upvotes: 1

Related Questions