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
Namespace: Unity.MARS.Providers
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 = default(MRHitTestResultTypes))
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 = default(MRHitTestResultTypes))
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 |