How does one convert from local coordinates to global coordinates in SFML. I currently have the following
triangle[0].position = sf::Vector2f(getPosition().x, getPosition().y);
triangle[1].position = sf::Vector2f(getPosition().x - 40.0f, getPosition().y + 50.0f);
triangle[2].position = sf::Vector2f(getPosition().x + 40.0f, getPosition().y + 50.0f);
when I call the following function
const sf::Vector2f Entity::getPositionVertex1() const
{
return sf::Vector2f(triangle[1].position.x, triangle[1].position.y);
}
I get the position of the vertex relative to the local orgin of the object. I instead want the global position of the vertex relative to the world origin.
From the image below, I want v1 not relative to the blue X (which is the objects local origin), but to the orange dot that is the global origin. Is this possible in SFML? Some help would be appreciated.