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

    Class XRRaycastSubsystem.Provider

    An interface to be implemented by providers of this subsystem.

    Inheritance
    Object
    XRRaycastSubsystem.Provider
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    protected class Provider

    Methods

    Destroy()

    Called when the subsystem is destroyed. Stop() will be called first if the subsystem is running.

    Declaration
    public virtual void Destroy()

    Raycast(XRRaycastHit, Ray, TrackableType, Allocator)

    Performs a raycast from an arbitrary ray against the types specified by trackableTypeMask. Results should be sorted by distance from the ray origin.

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

    The default raycast hit that should be used as a template when populating the returned NativeArray.

    Ray ray

    A ray in session space from which to raycast.

    TrackableType trackableTypeMask

    The types to raycast against.

    Allocator allocator

    The allocator with which to allocate the returned NativeArray.

    Returns
    Type Description
    NativeArray<XRRaycastHit>

    Raycast(XRRaycastHit, Vector2, TrackableType, Allocator)

    Performs a raycast from the camera against the types specified by trackableTypeMask. Results should be sorted by distance from the ray origin.

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

    The default raycast hit that should be used as a template when populating the returned NativeArray.

    Vector2 screenPoint

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

    TrackableType trackableTypeMask

    The types to raycast against.

    Allocator allocator

    The allocator with which to allocate the returned NativeArray.

    Returns
    Type Description
    NativeArray<XRRaycastHit>

    Start()

    Called when the subsystem is started. Will not be called again until Stop().

    Declaration
    public virtual void Start()

    Stop()

    Called when the subsystem is stopped. Will not be called before Start().

    Declaration
    public virtual void Stop()
    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