docs.unity3d.com
    Show / Hide Table of Contents

    Interface IXRRayProvider

    An interface that represents a Transform-driven XR Ray.

    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public interface IXRRayProvider

    Properties

    rayEndPoint

    The last endpoint of this ray, either its maximum distance or a collision point.

    Declaration
    Vector3 rayEndPoint { get; }
    Property Value
    Type Description
    Vector3

    rayEndTransform

    The Transform of the object this ray has collided with, if any.

    Declaration
    Transform rayEndTransform { get; }
    Property Value
    Type Description
    Transform

    Methods

    GetOrCreateAttachTransform()

    Ensures a Transform exists for the ray attach point and returns it.

    Declaration
    Transform GetOrCreateAttachTransform()
    Returns
    Type Description
    Transform

    The Transform that is used as the attach point for Interactables.

    GetOrCreateRayOrigin()

    Ensures a Transform exists for the ray origin and returns it.

    Declaration
    Transform GetOrCreateRayOrigin()
    Returns
    Type Description
    Transform

    The Transform that is the starting position and direction of any ray casts.

    SetAttachTransform(Transform)

    Assigns a Transform to be the attach point of this ray.

    Declaration
    void SetAttachTransform(Transform newAttach)
    Parameters
    Type Name Description
    Transform newAttach

    The Transform that is used as the attach point for Interactables.

    SetRayOrigin(Transform)

    Assigns a Transform to be the source of this ray.

    Declaration
    void SetRayOrigin(Transform newOrigin)
    Parameters
    Type Name Description
    Transform newOrigin

    The Transform that is the starting position and direction of any ray casts.

    See Also

    XRRayInteractor
    XRGazeAssistance
    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