Package apple.arkit

Class ARSession

  • All Implemented Interfaces:
    NSObject

    public class ARSession
    extends NSObject
    The ARSession class configures and runs different Augmented Reality techniques on a device.
    • Constructor Detail

      • ARSession

        protected ARSession​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • addAnchor

        public void addAnchor​(ARAnchor anchor)
        Adds an anchor to the session. The anchor will be added in the next frame update.
        Parameters:
        anchor - The anchor to add.
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • configuration

        public ARConfiguration configuration()
        The configuration currently being used by the session.
      • currentFrame

        public ARFrame currentFrame()
        The current frame of the session.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • delegate

        public ARSessionDelegate delegate()
        A delegate for receiving ARSession updates.
      • delegateQueue

        public NSObject delegateQueue()
        The dispatch queue on which the delegate calls are performed. If not provided or nil, delegate calls will be performed on the main queue.
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • pause

        public void pause()
        Pauses the session. Once paused, no more updates will be received from the session until run is called again.
      • removeAnchor

        public void removeAnchor​(ARAnchor anchor)
        Removes an anchor from the session. The anchor will be removed from subsequent frame updates.
        Parameters:
        anchor - The anchor to remove.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • runWithConfiguration

        public void runWithConfiguration​(ARConfiguration configuration)
        Runs the session with the provided configuration. Calling run on a session that has already started will transition immediately to using the new configuration.
        Parameters:
        configuration - The configuration to use.
      • runWithConfigurationOptions

        public void runWithConfigurationOptions​(ARConfiguration configuration,
                                                long options)
        Runs the session with the provided configuration and options. Calling run on a session that has already started will transition immediately to using the new configuration. Options can be used to alter the default behavior when transitioning configurations.
        Parameters:
        configuration - The configuration to use.
        options - The run options to use.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(ARSessionDelegate value)
        A delegate for receiving ARSession updates.
      • setDelegate

        public void setDelegate​(ARSessionDelegate value)
        A delegate for receiving ARSession updates.
      • setDelegateQueue

        public void setDelegateQueue​(NSObject value)
        The dispatch queue on which the delegate calls are performed. If not provided or nil, delegate calls will be performed on the main queue.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • getCurrentWorldMapWithCompletionHandler

        public void getCurrentWorldMapWithCompletionHandler​(ARSession.Block_getCurrentWorldMapWithCompletionHandler completionHandler)
        Copies the current state of the world being tracked by the session. A world map is only provided when running an ARWorldTrackingConfiguration.
        Parameters:
        completionHandler - The completion handler to call when the get has completed. This handler is executed on the session's delegate queue. The completion handler takes the following parameters: worldMap - The current world map or nil if unavailable. error - An error that indicates why the world map is unavailable, or nil if a world map was provided.
      • identifier

        public NSUUID identifier()
        Unique identifier of the running session. The identifier may change after calling runWithConfiguration.
      • raycast

        public NSArray<? extends ARRaycastResult> raycast​(ARRaycastQuery query)
        Perform a raycast.
        Parameters:
        query - Raycast query used for raycasting.
        Returns:
        List of raycast results, sorted from nearest to farthest (in distance from the camera). The results could be empty if raycast fails.
      • trackedRaycastUpdateHandler

        public ARTrackedRaycast trackedRaycastUpdateHandler​(ARRaycastQuery query,
                                                            ARSession.Block_trackedRaycastUpdateHandler updateHandler)
        Perform a tracked raycast. The session performs continuous raycasting and calls the update handler with the updated results. The ARTrackedRaycast object returned can be used to update the raycast with a new raycast query or stop raycasting.
        Parameters:
        query - Raycast query used for raycasting.
        updateHandler - update handler where updated list of results, sorted from nearest to farthest (in distance from the camera) are delivered. updateHandler will be called on session's delegate queue.
        Returns:
        Tracked raycast object used to update or stop raycasting. This could be nil if the raycast fails or if the configuration is not `ARWorldTrackingConfiguration` or its subclasses.
      • updateWithCollaborationData

        public void updateWithCollaborationData​(ARCollaborationData collaborationData)
        Update session with collaboration data. Use this to update the session with collaboration data received from other participants.
        Parameters:
        collaborationData - Collaboration data for updating the session.
        See Also:
        ARCollaborationData