docs.unity3d.com
    显示 / 隐藏目录

    Class IUsesHitTestingMethods

    Inheritance
    Object
    IUsesHitTestingMethods
    Namespace: Unity.MARS
    Syntax
    public static class IUsesHitTestingMethods

    Methods

    ScreenHitTest(IUsesMRHitTesting, Vector2, out MRHitTestResult, MRHitTestResultTypes)

    Perform a screen-based hit test against MR data

    Declaration
    public static bool ScreenHitTest(this IUsesMRHitTesting obj, Vector2 screenPosition, out MRHitTestResult result, MRHitTestResultTypes types = MRHitTestResultTypes.Any)
    Parameters
    Type Name Description
    IUsesMRHitTesting obj
    Vector2 screenPosition

    The screen position from which test will originate

    MRHitTestResult result

    The result of the hit test

    MRHitTestResultTypes types

    The types of results to test against

    Returns
    Type Description
    Boolean

    Whether the test succeeded

    StartHitTesting(IUsesMRHitTesting)

    Start performing hit tests. Hit test support is enabled on initialization, so this is only necessary after calling StopDetecting.

    Declaration
    public static void StartHitTesting(this IUsesMRHitTesting obj)
    Parameters
    Type Name Description
    IUsesMRHitTesting obj

    StopHitTesting(IUsesMRHitTesting)

    Stop performing hit tests. This will happen automatically on destroying the session. It is only necessary to call this method to pause plane detection while maintaining camera tracking

    Declaration
    public static void StopHitTesting(this IUsesMRHitTesting obj)
    Parameters
    Type Name Description
    IUsesMRHitTesting obj

    WorldHitTestHitTest(IUsesMRHitTesting, Ray, out MRHitTestResult, MRHitTestResultTypes)

    Perform a world-based hit test against MR feature points.

    Declaration
    public static bool WorldHitTestHitTest(this IUsesMRHitTesting obj, Ray ray, out MRHitTestResult result, MRHitTestResultTypes types = MRHitTestResultTypes.Any)
    Parameters
    Type Name Description
    IUsesMRHitTesting obj
    Ray ray

    The ray to test

    MRHitTestResult result

    The result of the hit test

    MRHitTestResultTypes types

    The types of results to test against

    Returns
    Type Description
    Boolean

    Whether the test succeeded

    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)