BioViewer
BioViewer copied to clipboard
Add inertia to camera controls
Add inertia to camera controls: when a UIPanGesture ends, the object should continue rotating for a bit, coming to a stop gradually. A proposed way to do it:
- Make UIPanGestureRecognizer change the rotational velocity of the object, not the rotational angle directly.
- Add a physics RunLoop for the object rotational speed, adding a configurable drag parameter to control how fast the rotation comes to a stop. This should probably come on its own RunLoop to avoid dependance on the screen frame rate.
- After all velocities have been added to the physics RunLoop, apply the drag effect and then compute the appropriate rotation transform.