【发布时间】:2021-01-29 11:07:51
【问题描述】:
将 RealityKit 的 installGestures 用于实体,我可以移动、旋转和调整它们的大小。这很酷,但我希望能够检测到用户何时完成移动对象以触发某些东西。
现在我有这个:
guard let entity = try? ModelEntity.loadModel(named: "\(name).usdz")
else {
NSLog("ERROR loading model")
return
}
entity.generateCollisionShapes(recursive: true)
arView.installGestures(.all, for: entity)
let anchorEntity = AnchorEntity(world: position)
anchorEntity.addChild(entity)
arView.scene.anchors.append(anchorEntity)
那么现在,我该如何处理gesture 事件以获得移动/调整大小的新位置?
谢谢!
【问题讨论】:
标签: swift augmented-reality arkit realitykit