Last active
June 20, 2018 09:34
-
-
Save simform-solutions/1ac394fd8f4b1511d39194ba76b21618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func receivedData(_ data: Data, from peer: MCPeerID) { | |
if let unarchived = try? NSKeyedUnarchiver.unarchivedObject(of: ARWorldMap.classForKeyedArchiver()!, from: data), let worldMap = unarchived as? ARWorldMap { | |
// Run the session with the received world map. | |
let configuration = ARWorldTrackingConfiguration() | |
configuration.planeDetection = .horizontal | |
configuration.initialWorldMap = worldMap | |
sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors]) | |
mapProvider = peer | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment