docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Raycast

    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>

    A NativeArray of all the resulting ray intersections.

    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>

    A NativeArray of all the resulting ray intersections.

    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023