BioViewer icon indicating copy to clipboard operation
BioViewer copied to clipboard

Add inertia to camera controls

Open Androp0v opened this issue 4 years ago • 0 comments

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.

Androp0v avatar Nov 01 '21 15:11 Androp0v