I'm trying to implement a camera that pans and zooms to always keep a set of points in view. Currently I center a sf::View on the average position of all objects in a std::vector< const sf::Vector2f* >, and that hasn't given me any trouble. Zooming is proving to be a pain though.
What I want to do is zoom out if any point is further from the center than a given distance, or zoom in if a point is less than a certain distance, with some kind of buffer. I've already tried using sf::Rect<>::Contains (unpredictable and choppy) and getting the length of a line between the center of the view and the points (unreliable as the view zooms out). Anybody have any tips?