yea but i calculate my pitch limit different and dont have all those scene nodes. i dont reset my pitch angle with quaternions as is done by the other system because it will also reset the yaw.
(that is because i dont have a sperate pitch and yaw node )
There is a small bug in that logic. If the value is over 90 or less than 90 you want to set it to the limit not to the old value. It is possible but probably rare for the mouse to move far enough in 1 frame that the value ends up outside the limit but the original value is well within it. In most cases this won't be a problem but its better to handle it that expect people not to notice that sometimes you get to 85 degrees and other times 87 degrees before it locks out.
I find it's much easier to generate a new camera orientation each frame and keep the pitch/yaw values in explicit variables. No need to normalise orientations to re-orthogonalise them (due to float error / drift), they are generated correctly each frame.