Class NearInteractionTouchableTests
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Tests
Assembly: cs.temp.dll.dll
Syntax
public class NearInteractionTouchableTests
Methods
NearInteractionTouchableDistance()
Test minimum touch distance.
Declaration
public IEnumerator NearInteractionTouchableDistance()
Returns
Type | Description |
---|---|
IEnumerator |
Remarks
Near interaction uses two separate distance calculations:
- The PokePointer uses the DistanceToTouchable to determine the closest touchable. This distance value is also used compared to PokePointer.TouchableDistance to determine the set of eligible touchables in the first place. There is no explicit spec which space this distance is computed in, although it should be in world space. Due to the way touchables convert pointer position into local space first and then do a scale-only inverse transform there may be errors.
- After the PokePointer has selected the closest touchable, it then performs a raycast against either the collider or the UnityUI canvas, depending on type. The (world space) length of that ray is then used as the actual distance for triggering touch events. When the ray length is negative the TouchDown event is raised and the touchable is "down". When the touchable is "down" and the ray length is greater than DebounceThreshold the TouchUp event is raised and the touchable is released.
The normal vector for performing the ray cast, however, is still the one returned by the first distance calculation.
NearInteractionTouchable also calculates distance from the object center, but the raycast ignores this and uses distance from the collider. UnityUI OTOH does a raycast against a flat canvas, so the two distance values should match (but it's not guaranteed).
NearInteractionTouchableDistance()
Test minimum touch distance.
Declaration
public IEnumerator NearInteractionTouchableDistance()
Returns
Type | Description |
---|---|
IEnumerator |
Remarks
Near interaction uses two separate distance calculations:
- The PokePointer uses the DistanceToTouchable to determine the closest touchable. This distance value is also used compared to PokePointer.TouchableDistance to determine the set of eligible touchables in the first place. There is no explicit spec which space this distance is computed in, although it should be in world space. Due to the way touchables convert pointer position into local space first and then do a scale-only inverse transform there may be errors.
- After the PokePointer has selected the closest touchable, it then performs a raycast against either the collider or the UnityUI canvas, depending on type. The (world space) length of that ray is then used as the actual distance for triggering touch events. When the ray length is negative the TouchDown event is raised and the touchable is "down". When the touchable is "down" and the ray length is greater than DebounceThreshold the TouchUp event is raised and the touchable is released.
The normal vector for performing the ray cast, however, is still the one returned by the first distance calculation.
NearInteractionTouchable also calculates distance from the object center, but the raycast ignores this and uses distance from the collider. UnityUI OTOH does a raycast against a flat canvas, so the two distance values should match (but it's not guaranteed).
NearInteractionTouchableInstantiate()
Test creating adding a NearInteractionTouchable to GameObject programmatically. Should be able to run scene without getting any exceptions.
Declaration
public IEnumerator NearInteractionTouchableInstantiate()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableInstantiate()
Test creating adding a NearInteractionTouchable to GameObject programmatically. Should be able to run scene without getting any exceptions.
Declaration
public IEnumerator NearInteractionTouchableInstantiate()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableOverlapQuerySaturation()
Test buffer saturation for the overlap query
Declaration
public IEnumerator NearInteractionTouchableOverlapQuerySaturation()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableOverlapQuerySaturation()
Test buffer saturation for the overlap query
Declaration
public IEnumerator NearInteractionTouchableOverlapQuerySaturation()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchablePointerEvents()
Test that NearInteractionTouchable can raise pointer events
Declaration
public IEnumerator NearInteractionTouchablePointerEvents()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableSetTouchableCollider()
Test the SetTouchableCollider(BoxCollider collider) method by checking if the touch event is raised when NearInteractionTouchable is added to a gameObject and if the bounds and box collider size is changed.
Declaration
public IEnumerator NearInteractionTouchableSetTouchableCollider()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableSetTouchableCollider()
Test the SetTouchableCollider(BoxCollider collider) method by checking if the touch event is raised when NearInteractionTouchable is added to a gameObject and if the bounds and box collider size is changed.
Declaration
public IEnumerator NearInteractionTouchableSetTouchableCollider()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableUnityUiButton()
Test Unity UI button
Declaration
public IEnumerator NearInteractionTouchableUnityUiButton()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableUnityUiButton()
Test Unity UI button
Declaration
public IEnumerator NearInteractionTouchableUnityUiButton()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableUnityUiToggle()
Test Unity UI toggle button
Declaration
public IEnumerator NearInteractionTouchableUnityUiToggle()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableUnityUiToggle()
Test Unity UI toggle button
Declaration
public IEnumerator NearInteractionTouchableUnityUiToggle()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableVariant()
Test creates an object with NearInteractionTouchable
Declaration
public IEnumerator NearInteractionTouchableVariant()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableVariant()
Test creates an object with NearInteractionTouchable
Declaration
public IEnumerator NearInteractionTouchableVariant()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableVolumeVariant()
Test creates an object with NearInteractionTouchableVolume
Declaration
public IEnumerator NearInteractionTouchableVolumeVariant()
Returns
Type | Description |
---|---|
IEnumerator |
NearInteractionTouchableVolumeVariant()
Test creates an object with NearInteractionTouchableVolume
Declaration
public IEnumerator NearInteractionTouchableVolumeVariant()
Returns
Type | Description |
---|---|
IEnumerator |
Setup()
Declaration
public void Setup()
Setup()
Declaration
public void Setup()
TearDown()
Declaration
public void TearDown()
TearDown()
Declaration
public void TearDown()