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

    Interface IProvidesMRHitTesting

    Defines the API for a MR hit testing provider This functionality provider is responsible for performing hit tests on feature points, planes, and point clouds

    Inherited Members
    IFunctionalityProvider.LoadProvider()
    IFunctionalityProvider.ConnectSubscriber(Object)
    IFunctionalityProvider.UnloadProvider()
    Namespace: Unity.MARS
    Syntax
    public interface IProvidesMRHitTesting : IFunctionalityProvider

    Methods

    ScreenHitTest(Vector2, out MRHitTestResult, MRHitTestResultTypes)

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

    Declaration
    bool ScreenHitTest(Vector2 screenPosition, out MRHitTestResult result, MRHitTestResultTypes types = MRHitTestResultTypes.Any)
    Parameters
    Type Name Description
    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()

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

    Declaration
    void StartHitTesting()

    StopHitTesting()

    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
    void StopHitTesting()

    WorldHitTest(Ray, out MRHitTestResult, MRHitTestResultTypes)

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

    Declaration
    bool WorldHitTest(Ray ray, out MRHitTestResult result, MRHitTestResultTypes types = MRHitTestResultTypes.Any)
    Parameters
    Type Name Description
    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)