Advertisement
Cabaca

Untitled

Aug 1st, 2024
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.54 KB | None | 0 0
  1. struct ImmersiveView: View {
  2.    
  3.     let session = ARKitSession()
  4.     let worldTracking = WorldTrackingProvider()
  5.     let rootEntity = Entity()
  6.  
  7.     var body: some View {
  8.         RealityView { content in
  9.            
  10.             // Set up session
  11.            
  12.             try? await session.run([worldInfo])
  13.         }
  14.       .task {
  15.                 for await anchorUpdate in worldTracking.anchorUpdates {
  16. switch anchorUpdate.event {
  17.     case .added:
  18.     // Related code
  19.     case .updated:
  20.     // Related code
  21.     case .removed:
  22.     // Related code
  23. }
  24.         }
  25.   }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement