{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct XRRaycastHit | AR Subsystems | 4.2.9
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRRaycastHit

    Represents the intersection of a raycast with a trackable.

    Implements
    IEquatable<XRRaycastHit>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: solution.dll
    Syntax
    public struct XRRaycastHit : IEquatable<XRRaycastHit>

    Constructors

    Name Description
    XRRaycastHit(TrackableId, Pose, float, TrackableType)

    Constructs an XRRaycastHit.

    Properties

    Name Description
    defaultValue

    A default-initialized raycast hit. This can be different from a zero-initialized raycast hit.

    distance

    The session-space distance from the raycast origin to the intersection point.

    hitType

    The types of trackables which were hit by the ray.

    pose

    The session-space Pose of the intersection.

    trackableId

    The TrackableId of the trackable which was hit. This can be invalidId as some trackables (for example, feature points) don't have ids.

    Methods

    Name Description
    Equals(object)

    Tests for equality.

    Equals(XRRaycastHit)

    Tests for equality.

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Operators

    Name Description
    operator ==(XRRaycastHit, XRRaycastHit)

    Tests for equality. Same as Equals(XRRaycastHit).

    operator !=(XRRaycastHit, XRRaycastHit)

    Tests for inequality. Same as !Equals(XRRaycastHit).

    See Also

    Raycast(Ray, TrackableType, Allocator)
    Raycast(Vector2, TrackableType, Allocator)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)