Advertisement
Cabaca

Untitled

Aug 1st, 2024
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.51 KB | None | 0 0
  1. switch anchorUpdate.event {
  2.         let anchor = anchorUpdate.anchor
  3.         case .added:
  4.             if let persistedEntity = worldAnchors[anchor.id] {
  5.     // create the entity using the persisted data to choose your model
  6.     // here it goes an example for the String as the filename of the 3d model
  7.         var entity = Entity(named: worldAnchors[anchor.id])
  8.         entity.position = anchor.originFromAnchorTransform.columns.3.xyz
  9.         entity.isEnabled = anchor.isTracked
  10.         rootEntity.addChild(entity)
  11. }
  12. // rest of the cases
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement