I would like to understand how to achieve that effect (see image).
When 2 objects or characters are close, the camera is close.
When the 2 objects are moving away, independently, the camera tries to keep both of them in the frame.
I’ve tried doing it by making my camera track the location between the two objects and align on an axis (it depends on the situation).
From that, I can move my camera away from that empty (but still track it) on an axis so that the camera view is larger.
The problem is : how can I calculate the good distance so that both objects are inside the “frustrum”?
I’d like to be able to know : if my camera is x units from the empty, and the camera is tracking the empty, one or both objects are outside the view.
Should I use (and study) maths for that?