I have a convex shape:
ConvexShape shape(3);
shape.setPoint(0,Vector2f(5,20));
shape.setPoint(1,Vector2f(5,30));
shape.setPoint(2,Vector2f(9,12));
I need the current position of points after moving, rotating, etc. Unfortunately virtual Vector2f sf::ConvexShape::getPoint(unsigned int index) const
returns old position
You can do:
shape.getTransform().transformPoint(shape.getPoint(0));
The online documentation isn't clear about this, but it has been clarified (https://github.com/SFML/SFML/blob/master/include/SFML/Graphics/ConvexShape.hpp#L96) in the source code already.
The returned point is in local coordinates, that is,
the shape's transforms (position, rotation, scale) are
not taken into account.
The result is undefined if \a index is out of the valid range.