Class XRRaycastSubsystem | AR Subsystems | 3.1.10
docs.unity3d.com
    Show / Hide Table of Contents

    Class XRRaycastSubsystem

    Base class for a raycast subsystem.

    Inheritance
    Object
    Subsystem
    Subsystem<XRRaycastSubsystemDescriptor>
    XRSubsystem<XRRaycastSubsystemDescriptor>
    XRRaycastSubsystem
    XRRaycastSubsystemImpl
    Inherited Members
    XRSubsystem<XRRaycastSubsystemDescriptor>.running
    XRSubsystem<XRRaycastSubsystemDescriptor>.Destroy()
    XRSubsystem<XRRaycastSubsystemDescriptor>.Start()
    XRSubsystem<XRRaycastSubsystemDescriptor>.Stop()
    Subsystem<XRRaycastSubsystemDescriptor>.SubsystemDescriptor
    Subsystem.OnDestroy()
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public abstract class XRRaycastSubsystem : XRSubsystem<XRRaycastSubsystemDescriptor>, ISubsystem
    Remarks

    This abstract class should be implemented by an XR provider and instantiated using the SubsystemManager to enumerate the available XRRaycastSubsystemDescriptors.

    Constructors

    XRRaycastSubsystem()

    Constructor. Do not invoke directly; use the SubsystemManager to enumerate the available XRRaycastSubsystemDescriptors and call Create on the desired descriptor.

    Declaration
    public XRRaycastSubsystem()

    Methods

    CreateProvider()

    Should return an instance of XRRaycastSubsystem.Provider.

    Declaration
    protected abstract XRRaycastSubsystem.Provider CreateProvider()
    Returns
    Type Description
    XRRaycastSubsystem.Provider

    The interface to the implementation-specific provider.

    OnDestroyed()

    Destroys the subsystem.

    Declaration
    protected override sealed void OnDestroyed()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRRaycastSubsystemDescriptor>.OnDestroyed()

    OnStart()

    Starts the subsystem.

    Declaration
    protected override sealed void OnStart()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRRaycastSubsystemDescriptor>.OnStart()

    OnStop()

    Stops the subsystem.

    Declaration
    protected override sealed void OnStop()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRRaycastSubsystemDescriptor>.OnStop()

    Raycast(Ray, TrackableType, Allocator)

    Casts ray against trackables specified with trackableTypeMask.

    Declaration
    public NativeArray<XRRaycastHit> Raycast(Ray ray, TrackableType trackableTypeMask, Allocator allocator)
    Parameters
    Type Name Description
    Ray ray

    A ray in session space.

    TrackableType trackableTypeMask

    The types of trackables to test for ray intersections.

    Allocator allocator

    The Allocator used to allocate the returned NativeArray.

    Returns
    Type Description
    NativeArray<XRRaycastHit>

    A NativeArray of all the resulting ray intersections.

    Raycast(Vector2, TrackableType, Allocator)

    Casts a ray originating from screenPoint against trackables specified with trackableTypeMask.

    Declaration
    public NativeArray<XRRaycastHit> Raycast(Vector2 screenPoint, TrackableType trackableTypeMask, Allocator allocator)
    Parameters
    Type Name Description
    Vector2 screenPoint

    A point on the screen in normalized screen coordinates (0, 0) - (1, 1)

    TrackableType trackableTypeMask

    The types of trackables to test for ray intersections.

    Allocator allocator

    The Allocator used to allocate the returned NativeArray.

    Returns
    Type Description
    NativeArray<XRRaycastHit>

    A NativeArray of all the resulting ray intersections.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023