Thanks Hapax, that's close but not exactly what I need and I'm trying to change it without good results.
That function works on the added rotation, I need it to work with the full rotation. Namely, instead of using rotate on the view I need to use setRotation, or figure out how to get the rotation to add instead of the full rotation.
So far I have this:
float rotationToAdd = m_view.getRotation() - HumanFieldPlayer::Instance().getSFMLAngleInDegrees();
float rotationInRadians = rotationToAdd * b2_pi / 180.f;
sf::Vector2f posCoords = HumanFieldPlayer::Instance().getSFMLPosition(); // in SFML Coordinates
posCoords.y -= Game::WindowHeight / 4.f;
const sf::Vector2f offset{ posCoords - m_view.getCenter() };
const float sine{ std::sin(rotationInRadians) };
const float cosine{ std::cos(rotationInRadians) };
const sf::Vector2f rotatedOffset{ cosine * offset.x - sine * offset.y, sine * offset.x + cosine * offset.y };
m_view.rotate(rotationToAdd);
m_view.move(offset - rotatedOffset);
Game::GetWindow()->setView(m_view);
I've tried several things, in this case I'm trying to get the rotation to add instead of the full rotation but when I rotate the player, the view goes crazy.