How to disable double-tap in defaultCameraController?

577 views Asked by At

In SCNScene, allowsCameraControl lets you move and rotate the camera, but when I "double-tap", the camera spins quickly and the object disappears.

I am reading the documentation, but I'm not sure how to disable double-tap.

2

There are 2 answers

0
trout On BEST ANSWER

SCNView is a subclass of UIView which has a property gestureRecognizers, an array of UIGestureRecognizers. You can loop through this array looking for the "double-tap" gesture. Once found, you can disable the gesture by setting isEnabled = false.

0
tospig On

setting .autoSwitchToFreeCamera = false also seems to work

lazy var sceneView: SCNView = {
    let sv = SCNView()
    sv.allowsCameraControl = true
    sv.cameraControlConfiguration.autoSwitchToFreeCamera = false
    return sv
}()