docs.unity3d.com
    Show / Hide Table of Contents

    Class IUsesHitTestingMethods

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

    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 = default(MRHitTestResultTypes))
    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 = default(MRHitTestResultTypes))
    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

    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