void Camera::Update(App& app)
{
if (currentEntity != nullptr)
{
float deltaX = currentEntity->getX()+8-getCenter().x;
float deltaY = currentEntity->getY()+8-getCenter().y;
float speedFactor = atan(app.getFrameTime()*speed)*2/3.14159265358979323846264338327950288419;
std::cout << speedFactor << " ;( ;( ;( :(\n";
setCenter(getCenter().x + deltaX*speedFactor, getCenter().y + deltaY*speedFactor);
}
}
When you call setView, the render-target keeps a copy of the view, not a pointer to the original one. So whenever you update your view, you need to call setView again to apply the modifications.
Wow, it seems that the more I emphasize an important point, the less people see it.You try too hard to document SFML well ;D. You should adopt the SFGUI documentation philosophy, minimal doxygen and tell people to go read code if they want more information ;).
From the tutorial, in a big red box:QuoteWhen you call setView, the render-target keeps a copy of the view, not a pointer to the original one. So whenever you update your view, you need to call setView again to apply the modifications.
This is really disappointing, I've spent one year to rewrite the complete set of tutorials, trying to put every important point in them.
>:( >:( >:( >:( >:( >:(