docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct AsyncRaycastResult

    Represents a Magic Leap asynchronous raycast result. The result must be created using AsyncRaycast(RaycastQuery). This API may be used from other threads.

    Implements
    IEquatable<AsyncRaycastResult>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.MagicLeap
    Assembly: UnityEngine.XR.MagicLeap.dll
    Syntax
    public struct AsyncRaycastResult : IEquatable<AsyncRaycastResult>

    Properties

    confidence

    The confidence of the result in the range 0..1, where 0 indicates low confidence and 1 is high confidence.

    Declaration
    public readonly float confidence { get; }
    Property Value
    Type Description
    float

    pose

    The pose of the raycast. The normal of the surface that was hit can be computed with pose.up. Only valid if state is SuccessHitObserved or SuccessHitUnobserved.

    Declaration
    public readonly Pose pose { get; }
    Property Value
    Type Description
    Pose

    state

    The state of the raycasts, e.g. whether it was successful, pending, or incountered an error. If the state is anything other than SuccessHitObserved or SuccessHitUnobserved, then the other values in this struct are meaningless.

    Declaration
    public RaycastResultState state { get; }
    Property Value
    Type Description
    RaycastResultState

    Methods

    Equals(object)

    IEquatable interface. Compares for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare for equality.

    Returns
    Type Description
    bool

    true if obj is of type AsyncRaycastResult and compares equal with Equals(AsyncRaycastResult).

    Overrides
    ValueType.Equals(object)

    Equals(AsyncRaycastResult)

    IEquatable interface. Comapres for equality.

    Declaration
    public bool Equals(AsyncRaycastResult other)
    Parameters
    Type Name Description
    AsyncRaycastResult other

    The AsyncRaycastResult to compare against.

    Returns
    Type Description
    bool

    true if all fields of this AsyncRaycastResult compare equal to other.

    GetHashCode()

    Computes a hash code suitable for use in a Dictionary or HashSet.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code suitable for use in a Dictionary or HashSet.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Generates a string representation of the raycast result of the form ": pose with confidence "

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the raycast result of the form ": pose with confidence "

    Overrides
    ValueType.ToString()

    Operators

    operator ==(AsyncRaycastResult, AsyncRaycastResult)

    Comapres for equality. Same as Equals(AsyncRaycastResult).

    Declaration
    public static bool operator ==(AsyncRaycastResult lhs, AsyncRaycastResult rhs)
    Parameters
    Type Name Description
    AsyncRaycastResult lhs

    The left-hand side of the comparison.

    AsyncRaycastResult rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    true if all fields of this AsyncRaycastResult compare equal to other.

    operator !=(AsyncRaycastResult, AsyncRaycastResult)

    Comapres for inequality. Same as !Equals(AsyncRaycastResult).

    Declaration
    public static bool operator !=(AsyncRaycastResult lhs, AsyncRaycastResult rhs)
    Parameters
    Type Name Description
    AsyncRaycastResult lhs

    The left-hand side of the comparison.

    AsyncRaycastResult rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    true if any of the fields of this AsyncRaycastResult are not equal to other.

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2025 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)