Thinking about a common game, doesn't matter the type of the game, it's very likely that we need some camera type. For example:
- Debug camera: controlled by keyboard and mouse, with that we are able to move around in any place of our scene.
- Scripted camera: with that we can instruct the camera to move around, following a determinate path.
- Player camera.
- ...
Each of these camera types has its own update function. The easiest (and bad) system,is to have a camera manager class with a generic update function and specialized update functions for every camera type. Inside the generic update function we have a switch statement that, based on the camera type, calls the proper update function.
Instead of this I've thought to another approach: strategy pattern. We move each camera behavior (update method) in an appropriate class that implements a common interface. In the camera manager we have a member to that interface, and we can set dinamically any behavior we want.
What do you think about that? What other systems do you suggest me? Thanks.
Additional info: there is the are real possibility that I need more than one camera active, for example for reflections. In short, I must take account also of that.