First of all I have to thank you for the quick response. Funnily, I thought of using const_cast on the matrix pointer beforehand but considered it as too "hacky".
There should be several possibilites how one could introduce this into the API:
- Each camera gets a state that determines whether it implements a symmetric or asymmetric projection including two methods that query and set the state. Then, an additonal method (possibly like
SetPlanesAsymmetric(float left, float right, float top, float bottom)
) could be used to transfer the wanted plane values to SAMSON. This approach would leave the old API intact, if the symmetric projection is the standard state. - Derive a class like SBDAsymmetricDocumentCamera from the currently available SBDDocumentCamera, overriding all methods concerning the projection matrix. This is probably the least favourable alternative, although the old API would still be valid.
- The camera gets two additional methods
SetValuesSymmetric(float aspect, float fovy, float zNear, float zFar)
andSetValuesAsymmetric(float left, float right, float top, float bottom, float zNear, float zFar)
. Then, theGetProjectionMatrix()
andGetProjectionMatrixTranspose()
methods would have to be changed to take an additional boolean input parameter determining which kind of matrix is wanted. This would break the old API and I am not sure how this would propagate to the convenience display methods likeSAMSON::displayCylinders(...)
.
Unfortunately I do not know which of these possibilities (and I probably missed some additional ones) would fit best into your way of writing SAMSON.
Best,
Karsten