Indeed
Distance would be the length of the vector (
thor::length), and rotation would be the polar angle (
thor::polarAngle). One option is also the
thor::PolarVector2f class, which stores magnitude and angle instead of X and Y coordinates.
With Thor, whitebeard86's code would look as follows (including a few corrections):
myObj.rotation = thor::polarAngle(waypoint - myObj.position);
myObj.position += thor::unitVector(waypoint - myObj.position) * SPEED * deltaTime;
float distance(sf::Vector2f p1, sf::Vector2f p2) {
return thor::length(p1 - p2);
}