I am tracking the path of a ball (CircleShape) that rolls around an irregular landscape. As long as I had a ball-shaped sprite and just copied position and rotation it worked just fine, but now I want to show a different object that is not at all ball shaped, at the same time as I want to set a manual rotation of this displayed sprite.
I think the problem is that the rotation is not around the center, but rather around a corner, and maybe it is that way in the CircleShape as well? I can't really find this information.
I've tried to rotate with matrix translations but I'm still doing something wrong.
Some more facts:
The ball rolling around is 15px in radius, 30px in diameter. The object I want to display instead is 30x70px and the place to rotate around is at the coordinates 15x55px, that is, at the center of a circle inscribed at the bottom of that rectangle. I've also tried making the sprite bigger, to 110x110px with transparency to get the center of the sprite to match, but obviously the rotation is not around the center.
Is there a way to do this computation, correctly using the positional data of the CircleShape and a manual rotation together?