Swift 使用ARKit 3.0在iPhone XR上进行人员细分
以下代码在iPhone XR上返回false,即使它正在XR上工作Swift 使用ARKit 3.0在iPhone XR上进行人员细分,swift,augmented-reality,arkit,occlusion,iphone-xr,Swift,Augmented Reality,Arkit,Occlusion,Iphone Xr,以下代码在iPhone XR上返回false,即使它正在XR上工作 ARConfiguration.supportsFrameSemantics(.personSegmentation) 我想知道它是否正式支持XR上的人物分割和深度人物分割。我要指出的是,我已经在XR上安装了iOS 13.1.2。试试这个变体: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) let
ARConfiguration.supportsFrameSemantics(.personSegmentation)
我想知道它是否正式支持XR上的人物分割和深度人物分割。我要指出的是,我已经在XR上安装了iOS 13.1.2。试试这个变体:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let config = ARWorldTrackingConfiguration()
if ARWorldTrackingConfiguration.supportsFrameSemantics(.personSegmentationWithDepth) {
config.frameSemantics = .personSegmentationWithDepth
}
arView.session.run(config)
}
并确保您的Xcode版本为11.2.1,iOS版本为13.2.3,我正在使用ArcConfiguration检查支持情况。我需要使用ARWorldTrackingConfiguration来检查支持情况。
ArcConfiguration
是ARKit中所有类型配置的基类,但是ARWorldTrackingConfiguration
是具有六个自由度的主类。