docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryAddRaycast

    TryAddRaycast(Vector2, float, out XRRaycast)

    Attempts to add a new persistent raycast. The raycast will be updated automatically until this subsystem is stopped or destroyed, or the the raycast is removed with RemoveRaycast(TrackableId).

    Declaration
    public bool TryAddRaycast(Vector2 screenPoint, float estimatedDistance, out XRRaycast raycast)
    Parameters
    Type Name Description
    Vector2 screenPoint

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

    float estimatedDistance

    The estimated distance to the raycast target. For example, an average human height might be used to estimate the distance to the floor.

    XRRaycast raycast

    The newly added raycast. All spatial data is relative to the XR origin.

    Returns
    Type Description
    bool

    True if the raycast was successfully added, or false otherwise.

    TryAddRaycast(Ray, float, out XRRaycast)

    Attempts to add a new persistent raycast. The raycast will be updated automatically until this subsystem is stopped or destroyed, or the the raycast is removed with RemoveRaycast(TrackableId).

    Declaration
    public bool TryAddRaycast(Ray ray, float estimatedDistance, out XRRaycast raycast)
    Parameters
    Type Name Description
    Ray ray

    A ray relative to the XR origin defining the raycast.

    float estimatedDistance

    The estimated distance to the raycast target. For example, an average human height might be used to estimate the distance to the floor.

    XRRaycast raycast

    The newly added raycast. All spatial data is relative to the XR origin.

    Returns
    Type Description
    bool

    True if the raycast was successfully added, or false otherwise.

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