当allowsCameraControl = true 时,如何禁用场景视图中的某些默认功能? [英] How to disabled some default functionality in Scene view when allowsCameraControl = true?
本文介绍了当allowsCameraControl = true 时,如何禁用场景视图中的某些默认功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助我,我在场景视图中设置了allowsCameraControl = true".如何禁用某些默认功能.Ex:用两根手指平移以在其局部 xy 平面上平移相机
Please Help me, I have setup "allowsCameraControl = true" in Scene view. How to disabled some default functionality. Ex : Pan with two fingers to translate the camera on its local xy-plane
scnview.allowsCameraControl = true
scnview.defaultCameraController.interactionMode = .orbitTurntable
scnview.defaultCameraController.inertiaEnabled = true
scnview.defaultCameraController.maximumVerticalAngle = 69
scnview.defaultCameraController.minimumVerticalAngle = -69
scnview.autoenablesDefaultLighting = true
推荐答案
您可以在设置 allowsCameraControl = true
后禁用/修改或添加更多识别器.
You can disable/modify or add more recognisers after setting allowsCameraControl = true
.
if let recognizers = scnview.gestureRecognizers {
for gestureRecognizer in recognizers {
if let gesture = gestureRecognizer as? UIPanGestureRecognizer {
gestureRecognizer.isEnabled = false
}
}
}
这篇关于当allowsCameraControl = true 时,如何禁用场景视图中的某些默认功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文