Advertisement
Guest User

Untitled

a guest
May 24th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
  2.  
  3. guard let touch = touches.first else { return }
  4.  
  5. let touchPoint = touch.location(in: yourARsceneOUTLET)
  6.  
  7. let results = yourARsceneOUTLET.hitTest(touchPoint, types: [.featurePoint])
  8.  
  9. guard let result = results.last else { return}
  10.  
  11. let hitTransform = SCNMatrix4(result.worldTransform)
  12.  
  13. let position = SCNVector3Make(hitTransform.m41, hitTransform.m42, hitTransform.m43)
  14.  
  15. addModel(position: position) // the function that has the Alert with textField
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement