I'm developing 4-players game using ARKit. I know how to save and then to get a worldMap
. It's not difficult.
sceneView.session.getCurrentWorldMap { worldMap, error in
guard let map = worldMap
else { self.showAlert(title: "Can't get current world map", message: error!.localizedDescription); return }
guard let snapshotAnchor = SnapshotAnchor(capturing: self.sceneView)
else { fatalError("Can't take snapshot") }
map.anchors.append(snapshotAnchor)
do {
let data = try NSKeyedArchiver.archivedData(withRootObject: map, requiringSecureCoding: true)
try data.write(to: self.mapSaveURL, options: [.atomic])
DispatchQueue.main.async {
self.loadExperienceButton.isHidden = false
self.loadExperienceButton.isEnabled = true
}
} catch {
fatalError("Can't save map: \(error.localizedDescription)")
}
}
But I don't know how to track with iPhone the following place (it's 50x50 meters) to generate this worldMap
.
Could you give me an idea how to track this space?