Can ARView switch between camera and non-camera mode?

AR Quick Look has two modes: Object Mode: one can view a model in an empty space with a ground plane and a shadow AR Mode: one can view the model in an SR context, within a real environment

Does the developer have access to this functionality (moving between camera and non-camera modes)? I'm really asking if the camera can be disabled and reenabled in the same session.

Thanks

Answered by spiff in 707603022

This can be achieved by setting the background in the environment:

// disable camera
arView.environment.background = .color(.white)

// enable camera
arView.environment.background = .cameraFeed()
Accepted Answer

This can be achieved by setting the background in the environment:

// disable camera
arView.environment.background = .color(.white)

// enable camera
arView.environment.background = .cameraFeed()

Although I marked this as the correct answer it is in fact incomplete. This changes the background but the camera is in fact still active, while you move the camera, the relative orientation of the device changes.

The complete answer is that ARView has a cameraMode property which is equivalent to the argument in the initializer.

arView.cameraMode = .nonAr // for example

How I missed this is beyond me :-)

Can ARView switch between camera and non-camera mode?
 
 
Q