这是看起来很好的模型属性。
这是有问题的模型的属性,并且在相机视图上方显得更大:
这是我插入模型的代码:
func updateUIView(_ uiView: ARView, context: Context) {
// My Custom Class
guard let model = modelConfirmedForPlacement else { return }
if let modelEntity = model.modelEntity {
print("Adding model to scene: \(model.modelName)")
let anchorEntity = AnchorEntity(plane: .any)
let readyModelEntity = modelEntity.clone(recursive: true)
//Add Gestures Support for Model
readyModelEntity.generateCollisionShapes(recursive: true)
anchorEntity.addChild(readyModelEntity)
uiView.scene.addAnchor(anchorEntity)
// Install Gestures
uiView.installGestures([.all], for: readyModelEntity)
} else {
print("Unable to load modelEntity for: \(model.modelName)")
}
DispatchQueue.main.async {
modelConfirmedForPlacement = nil
}
}