Ah yeah, I see. Still, the
getBillboardVectors method is preferable, I think. Might both be faster and more accurate (edit: internally,
getBillboardVectors also uses
glm::rotate( mOrientation, vec3( 1, 0, 0 ) ), so accuracy is the same. However, since the resulting vector is then stored in the view matrix and this matrix is cached, calling
getBillboardVectors may be faster if the camera does not change. If the camera does change, it will be slower. For performance reasons, you should stick to
glm::rotate( mOrientation, vec3( 1, 0, 0 ) ) ).
Gosh, it’s been a few weeks since I programmed in C++ and somehow I’m having a hard time remembering how things worked (it will all come back to me, no worries), but the correct way of applying the rotation would be:
// Obtain pitch axis.
vec3 pitchAxis, yawAxis;
mCam.getBillboardVectors( &pitchAxis, &yawAxis );
// Create pitch quaternion.
auto pitch = glm::angleAxis( pitchAngleInRadians, pitchAxis );
// Obtain current orientation.
auto orientation = mCam.getOrientation();
// Modify current orientation by applying pitch quaternion.
mCam.setOrientation( orientation * pitch ); // might also be pitch * orientation