Struct AsyncRaycastResult | Magic Leap XR Plugin | 6.0.0
docs.unity3d.com
    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.

    Namespace: UnityEngine.XR.MagicLeap
    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 float confidence { get; }
    Property Value
    Type Description
    Single

    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 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
    Boolean

    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
    Boolean

    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
    Int32

    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 "{state}: pose {pose} with confidence {confidence}"

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

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

    Overrides
    ValueType.ToString()

    Operators

    Equality(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
    Boolean

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

    Inequality(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
    Boolean

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

    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