ARKit snap objects

Hello, I am creating an app like the ikea furniture app where you can place AR objects in to see how they look. My question is there a way to use the bounding boxes as snap points? What I’m trying to accomplish is having the objects in a line by using their bounding boxes extents as snap points. Any help would be much appreciated!

You could implement your own logic in the gesture recognizers for placing the objects. Essentially, you would need to keep track of the objects already placed in the scene. Then, when updating the manipulated object's transform based on the gesture recognizer's input, you'd check if another object's bounding box is close enough and then update the position to "snap" to that object.

You might want to check out at the developer sample Scanning and Detecting 3D Objects. While the sample's primary purpose is to scan real-world objects for ARKit's object detection feature, it also has a feature to fine-tune the scan's bounding box. That part contains a snapping functionality when manipulating the sides or the origin of the bounding box. The classes where this is implemented are BoundingBox.swift, ObjectOrigin.swift, and Snapping.swift. Maybe this is helpful as an inspiration for your own implementation in the described use case.

ARKit snap objects
 
 
Q