This patch intends to fix Bug 213599 and incorrect reflection when rotating the cube using arrow keys (see screencasts)
The main problem was that inside the effect there was manualVerticalAngle, which did not represent the actual rotation angle of the cube during the animation, but used to calculate the position of the reflection. The actual angle was calculated on-the-fly and was not exposed outside. Yet I found the code related for such animations rather cumbersome, with lots of code duplication, so I tried to reorganize it, though keeping the logic (as I understood it).
Brief description of what the code does:
- variables currentAngle and verticalCurrentAngle now always represent the current position of the cube. They are updated when one uses the mouse and inside the rotateCube() method, which is called in prePaintScreen().
- two queues, animations (used for Start / Stop / Left / Right) and verticalAnimations (used for Up / Down) are used for scheduling the animations if i.e. user presses several keys in a row. The code checks whether the last animation has finished (and thus we need to start a new one) inside prePaintScreen() and postPaintScreen() (not sure if two places actually needed though).
- when the animation starts, code saves the starting position of the cube inside startAngle, startFrontDesktop and verticalStartAngle variables, which are used to calculate the actual cube position during the animation later. This is done by startAnimation() and startVerticalAnimation(), which also calculates the QTimeLine curves needed for animation
It also fixes Bug 373101, that is incorrect reflection for cylinder (see another screencast), and adds reflection for sphere (with correct position as well).
If one uses sphere cap deformation, the caps were ill-positioned (didn't find a bug on bugzilla though), I have also fixed that
Last two issues are actually somewhat separate, I guess I can prepare two another differential revisions if needed.