void Camera::RotateProjection(int rotationAngle)
{
- mProjectionRotation = rotationAngle;
- mUpdateViewFlag = UPDATE_COUNT;
+ mProjectionRotation = rotationAngle;
+ mUpdateProjectionFlag = UPDATE_COUNT;
}
const Matrix& Camera::GetProjectionMatrix(BufferIndex bufferIndex) const
// Early-exit if no update required
if(0u != mUpdateProjectionFlag)
{
+ Matrix& finalProjection = mFinalProjection[updateBufferIndex];
+ finalProjection.SetIdentity();
+
if(COPY_PREVIOUS_MATRIX == mUpdateProjectionFlag)
{
// The projection matrix was updated in the previous frame; copy it
mProjectionMatrix.CopyPrevious(updateBufferIndex);
+
+ finalProjection = mFinalProjection[updateBufferIndex ? 0 : 1];
}
else // UPDATE_COUNT == mUpdateProjectionFlag
{
mProjectionMatrix.SetDirty(updateBufferIndex);
- Matrix& finalProjection = mFinalProjection[updateBufferIndex];
- finalProjection.SetIdentity();
-
Quaternion rotationAngle;
switch(mProjectionRotation)
{