Interface ARSessionObserver

    • Method Detail

      • sessionCameraDidChangeTrackingState

        default void sessionCameraDidChangeTrackingState​(ARSession session,
                                                         ARCamera camera)
        This is called when the camera’s tracking state has changed.
        Parameters:
        session - The session being run.
        camera - The camera that changed tracking states.
      • sessionDidFailWithError

        default void sessionDidFailWithError​(ARSession session,
                                             NSError error)
        This is called when a session fails. On failure the session will be paused.
        Parameters:
        session - The session that failed.
        error - The error being reported (see ARError.h).
      • sessionDidOutputAudioSampleBuffer

        default void sessionDidOutputAudioSampleBuffer​(ARSession session,
                                                       CMSampleBufferRef audioSampleBuffer)
        This is called when the session outputs a new audio sample buffer.
        Parameters:
        session - The session being run.
        audioSampleBuffer - The captured audio sample buffer.
      • sessionInterruptionEnded

        default void sessionInterruptionEnded​(ARSession session)
        This is called when a session interruption has ended. 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:]`).
        Parameters:
        session - The session that was interrupted.
      • sessionWasInterrupted

        default void sessionWasInterrupted​(ARSession session)
        This is called when a session is interrupted. 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.
        Parameters:
        session - The session that was interrupted.
      • sessionDidOutputCollaborationData

        default void sessionDidOutputCollaborationData​(ARSession session,
                                                       ARCollaborationData data)
        This is called when the session generated new collaboration data. This data should be sent to all participants.
        Parameters:
        session - The session that produced world tracking collaboration data.
        data - Collaboration data to be sent to participants.
        See Also:
        ARCollaborationData
      • sessionShouldAttemptRelocalization

        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. 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.
        Parameters:
        session - The session to relocalize.
        Returns:
        Return YES to begin relocalizing.
      • sessionDidChangeGeoTrackingStatus

        default void sessionDidChangeGeoTrackingStatus​(ARSession session,
                                                       ARGeoTrackingStatus geoTrackingStatus)
        This is called when geo tracking status changes.
        Parameters:
        session - The session being run.
        geoTrackingStatus - Latest geo tracking status.