Members - Reputation: 208
Posted 28 April 2012 - 10:47 AM
we have a class name ViewMatrix suppose and it have got a Matrix as member and some other functions. I want to make it static , I will update this matrix member using it's function update and will get it's value using get function or simply viewMatrix.matrix ...
I don't have to keep a seperate copy of view matrix for each point I am rendering on screen ( Actually I will be rendering thousands of points at same time ) .. no object will be created for this class this way too ...
Members - Reputation: 1694
Posted 28 April 2012 - 11:49 AM
You can have a hierarchy of camera types, for example an abstract class Camera having view and proj matrices as members and pure virtual methods BuildProj() and BuildView(). Then two abstract subclasses OrthoCamera and PerspectiveCamera, each of them with its own implementation of BuildProj().
And finaly subclasses like for example OrbitCamera, FPSCamera etc etc, each with its own implemenation of BuildView().
But of course it depends all on you, it's your code. That's just my suggestion. Btw I hope the suggestion makes sense, I pulled it out of my head