public interface ARSessionObserver
| Modifier and Type | Method and Description |
|---|---|
default void |
sessionCameraDidChangeTrackingState(ARSession session,
ARCamera camera)
This is called when the camera’s tracking state has changed.
|
default void |
sessionDidChangeGeoTrackingStatus(ARSession session,
ARGeoTrackingStatus geoTrackingStatus)
This is called when geo tracking status changes.
|
default void |
sessionDidFailWithError(ARSession session,
NSError error)
This is called when a session fails.
|
default void |
sessionDidOutputAudioSampleBuffer(ARSession session,
CMSampleBufferRef audioSampleBuffer)
This is called when the session outputs a new audio sample buffer.
|
default void |
sessionDidOutputCollaborationData(ARSession session,
ARCollaborationData data)
This is called when the session generated new collaboration data.
|
default void |
sessionInterruptionEnded(ARSession session)
This is called when a session interruption has ended.
|
default boolean |
sessionShouldAttemptRelocalization(ARSession session)
This is called after a session resumes from a pause or interruption to determine
whether or not the session should attempt to relocalize.
|
default void |
sessionWasInterrupted(ARSession session)
This is called when a session is interrupted.
|
default void sessionCameraDidChangeTrackingState(ARSession session, ARCamera camera)
session - The session being run.camera - The camera that changed tracking states.default void sessionDidFailWithError(ARSession session, NSError error)
On failure the session will be paused.
session - The session that failed.error - The error being reported (see ARError.h).default void sessionDidOutputAudioSampleBuffer(ARSession session, CMSampleBufferRef audioSampleBuffer)
session - The session being run.audioSampleBuffer - The captured audio sample buffer.default void sessionInterruptionEnded(ARSession session)
A session will continue running from the last known state once the interruption has ended. If the device has moved, anchors will be misaligned. To avoid this, some applications may want to reset tracking (see ARSessionRunOptions) or attempt to relocalize (see `-[ARSessionObserver sessionShouldAttemptRelocalization:]`).
session - The session that was interrupted.default void sessionWasInterrupted(ARSession session)
A session will be interrupted and no longer able to track when it fails to receive required sensor data. This happens when video capture is interrupted, for example when the application is sent to the background or when there are multiple foreground applications (see AVCaptureSessionInterruptionReason). No additional frame updates will be delivered until the interruption has ended.
session - The session that was interrupted.default void sessionDidOutputCollaborationData(ARSession session, ARCollaborationData data)
This data should be sent to all participants.
session - The session that produced world tracking collaboration data.data - Collaboration data to be sent to participants.ARCollaborationDatadefault boolean sessionShouldAttemptRelocalization(ARSession session)
To avoid misaligned anchors, apps may wish to attempt a relocalization after a session pause or interruption. If YES is returned: the session will begin relocalizing and tracking state will switch to limited with reason relocalizing. If successful, the session's tracking state will return to normal. Because relocalization depends on the user's location, it can run indefinitely. Apps that wish to give up on relocalization may call run with `ARSessionRunOptionResetTracking` at any time.
session - The session to relocalize.default void sessionDidChangeGeoTrackingStatus(ARSession session, ARGeoTrackingStatus geoTrackingStatus)
session - The session being run.geoTrackingStatus - Latest geo tracking status.