Class 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.FeaturePoint | MRHitTestResultTypes.HorizontalPlane | MRHitTestResultTypes.VerticalPlane | MRHitTestResultTypes.Plane | 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.FeaturePoint | MRHitTestResultTypes.HorizontalPlane | MRHitTestResultTypes.VerticalPlane | MRHitTestResultTypes.Plane | 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 |