docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Raycast

    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.

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