Hello all,
I'm wondering what would be the best way to create a rotatable rectangle? I don't want it to have a texture, or be drawable, however I do want it to have an origin (and location) and be able to retrieve it's four coordinates depending on its rotation.
For example (all psuedocode of course):
RotateRect Rect;
Rect.setSize(x1, y1, x2, y2);//x2/y2 can be width and height, it doesn't matter
Rect.setOrigin(sf::Vector2f(10, 10));
Rect.setRotation(63);
Now I want to be able to to get the x1, x2, y1, and y2 coordinates on runtime given it's rotation. Would it be better to create a class that does the trig-math stuff on it's own, or try to inherit from sf::Transformable? If it does inhert from sf::Transformable, how do I get the vertices' coordinates?
Again, I do not want it to be drawn, so inheriting from sf::Shape or sf::RectShape is a bit too heavy.