Search code examples
scenekitarkit

ARAnchor / SCNNode relation


Using ARKit, I have a use case where I need, from a touch event to retrieve the touched Node, and update it with some of its Anchor information.

With ARKit, I can retrieve the touched anchor, but then, how to get the related node ?

or

With SceneKit, I can retrieve the touched node, but then, how to get the related anchor ?

The only I found was to maintain a relationship table myself, using the various delegate's calls. Is there any smarter way ?


Solution

  • The ARSCNView class exposes both -anchorForNode: and -nodeForAnchor:.