In my camera class I store four vectors. One for position and then one each for left, up and forward for the rotation. Then at the end of my camera's update I create the view matrix via something like:
m_view = Matrix::CreateLookAt(m_position, m_position + m_foward, m_up);
Anyway, my camera has a function for adding rotation which gets called from the input component and it looks something like this:
void Camera::AddRotation(const Matrix& rRotAdd)
{
Matrix tempMat(m_left, m_up, m_forward);
tempMat = rRotAdd * tempMat;
m_left = tempMat.GetColumn0();
m_up = tempMat.GetColumn1();
m_forward = tempMat.GetColumn2();
}
As you can see, I create a temporary matrix from the rotation member variables so that I can add on the rotation that's passed in and then re-set the vectors from the resulting matrix.
This seems to work fine if I only update the rotation on one axis, so just the pitch or just the yaw. But if I try to rotate in both pitch and yaw I'm not seeing the results I expect. The camera actually appears to roll and the effect is worse the more pitch/yaw I put on.
I can record a video of what it looks like if the issue isn't immediately obvious.