As I have said before, this is identical to my XNA camera. I know, not the best camera in the world, but this is the base of other cameras I will be producing later. So, as before we have a header file and cpp file.
The header looks like this:
The ctor and dtor are there as expected, then two methods to get the cameras View and Projection Matrix, an update method, translate and rotate then methods to set the position, target and rotation, height and width (for the viewport) and finally a method to get the camera position. Then the protected members.
The methods look like this:
Not sure what else to add here, it is pretty simple stuff, the only method of real note is the Update method as this is where the View and Projection Matrices are set, but this is done exactly the same as before in my XNA Camera class.
This post has been a bit light I know, the terrain class will be next and then the main.cpp, this will show how it all hangs together and in that last post I will put up a solution to download so you can have a play with it.
As ever C&C are welcome :)