float rad = sprite.getRotation() / 180 * PI;
this looks wrong.
Unless your trying to turn from rad to deg, but sprite.getRoation() doesn't return radians.
Isn't the equation for transforming degrees to radians * PI/180?
However I still suggest to use sf::Transform (nice interface to a 3D matrix) or even create a class and derive from sf::Transformable, so you can apply the rotation in an easy way and reuse the transformation for all the different points. Just look it up in the documentation/tutorial, it's really simple to use.
I'm trying to use sf::Transform, but I don't think I quite understand how it works.
collide_box[0] = sf::Vector2f(collide_rect.left, collide_rect.top);
collide_box[1] = sf::Vector2f(collide_rect.left + collide_rect.width, collide_rect.top);
collide_box[3] = sf::Vector2f(collide_rect.left, collide_rect.top + collide_rect.height);
collide_box[2] = sf::Vector2f(collide_rect.left + collide_rect.width, collide_rect.top + collide_rect.height);
float offset_x = collide_rect.width / 2 + collide_rect.left;
float offset_y = collide_rect.height / 2 + collide_rect.top;
float rad = sprite.getRotation() * PI / 180;
for(int i = 0; i < 4; i++)
{
sf::Transform t;
t.transformPoint(collide_box[i]);
t.rotate(rad, offset_x, offset_y);
}
This is just giving me a point outside of the rectangle.