capturedStructure(from:)
Combines the argument captured rooms into a single unit.
Declaration
func capturedStructure(from rooms: [CapturedRoom]) async throws -> CapturedStructureParameters
- rooms:
An array of captured room objects the app generates by performing multiple room-capture sessions in the same physical vicinity.
Mentioned in
Return Value
An object that consists of all of the captured room data across one or more scan sessions.
Discussion
Each captured room in the argument array represents the post-processed result of a single scan session. This function succeeds when all of the captured rooms share compatible world space; otherwise, the function fails with an error. CapturedRoom instances share compatible world space if they reside in the same physical vicinity (they connect to form a larger structure), such as different rooms in the same building.
There are two ways to ensure the captured rooms share compatible world space. You continue a single AR session by:
Passing the same ARSession instance to the RoomCaptureSession objects that each produce a captured room. Be sure to pause the
ARSessionby calling stop(pauseARSession:) with an argument offalsebefore handing it to a subsequent room-capture session.Loading a previously saved ARWorldMap to create an
ARSessionin compatible world space with previous scans.
For information about saving and loading world maps to restore an ARSession, see Saving and loading world data.