The class CameraPerspAsym extends CameraPersp and has this constructor:
CameraPerspAsym( int pixelWidth, int pixelHeight, float fov, float nearPlane, float farPlane )
: CameraPersp(pixelWidth, pixelHeight, fov, nearPlane, farPlane),
mLensShiftX(0.0f),
mLensShiftY(0.0f){};
(I’ve put it in 4 lines for easier reading)
AFAIK it seems the params ( int pixelWidth, int pixelHeight etc ... ) are passed to the base class. But what about the mLensShiftX(0.0f) ?
So how should I call this contructor?
You only need to worry about supplying arguments for the child-class’s constructor, in this case
int pixelWidth, int pixelHeight, float fov, float nearPlane, float farPlane. How it passes those arguments to its parent, or uses them to initialize its members, is an implementation details and hidden from you.The
mLensShiftX(0.0f), mLensShiftY(0.0f)is the class explicitly initializing two instance variables with the value0.0f, and you don’t need to do anything when using the classCameraPerspAsymto allow that to happen, neither can you specify alternate values. You’ll have to use the interface the class exposes to alter those values after the constructor has run.