Class PointerTests
Tests to verify pointer state and pointer direction
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Tests
Assembly: cs.temp.dll.dll
Syntax
public class PointerTests
Methods
Setup()
Set initial state before each test.
Declaration
public IEnumerator Setup()
Returns
Type | Description |
---|---|
IEnumerator | enumerator |
Remarks
Note that, in order to catch incorrect reliances on identity camera transforms early on, this Setup() sets the playspace transform to an arbitrary pose. This can be overridden where appropriate for an individual test by starting off with, e.g., PlayspaceToOriginLookingForward(). However, it is preferable to retain the arbitrary pose, and use the helpers within TestUtilities to align test objects with the camera. For example, to place an object 8 meters in front of the camera, set its global position to: TestUtilities.PositionRelativeToPlayspace(0.0f, 0.0f, 8.0f); See usage of these helpers throughout the tests within this file, e.g. TestSpherePointerInsideGrabbable(). See also comments at PlayspaceToArbitraryPose().
TearDown()
Declaration
public IEnumerator TearDown()
Returns
Type | Description |
---|---|
IEnumerator |
TestDestroyOnSourceLostPointer()
As GameObjects, pointers can be destroyed at any time. Utilize BaseControllerPointer.DestroyOnSourceLost property to test pointer cache does not break with null references (aka auto-destroyed pointers).
Declaration
public IEnumerator TestDestroyOnSourceLostPointer()
Returns
Type | Description |
---|---|
IEnumerator |
TestDisabledPointerCache()
Test that buttons still work when pointer cache is disabled. Pointers that do not auto-destroy themselves on source lost should be destroyed by the input device manager creating the pointers
Declaration
public IEnumerator TestDisabledPointerCache()
Returns
Type | Description |
---|---|
IEnumerator |
TestHandPointerDirectionToCameraDirection()
Tests that right after hand being instantiated, the pointer's direction is in the same general direction as the forward direction of the camera
Declaration
public IEnumerator TestHandPointerDirectionToCameraDirection()
Returns
Type | Description |
---|---|
IEnumerator |
TestLinePointers()
Tests that line pointers and curve pointer work as expected by using default prefab implementations LinePointer should be a straight line ray while curve pointers should collide along the curve via ray-marching
Declaration
public IEnumerator TestLinePointers()
Returns
Type | Description |
---|---|
IEnumerator |
TestMotionControllerPointerDirectionToCameraDirection()
Tests that right after motion controller being instantiated, the pointer's direction is in the same general direction as the forward direction of the camera
Declaration
public IEnumerator TestMotionControllerPointerDirectionToCameraDirection()
Returns
Type | Description |
---|---|
IEnumerator |
TestPointerCaching()
Test that the same PokePointer
- is not destroyed
- retrieved and re-used from the pointer cache
- still click buttons and provides input after re-use
Declaration
public IEnumerator TestPointerCaching()
Returns
Type | Description |
---|---|
IEnumerator |
TestPointerFOV()
Tests that pointers behave correctly when interacting with objects inside and outside its field of view
Declaration
public IEnumerator TestPointerFOV()
Returns
Type | Description |
---|---|
IEnumerator |
TestPointerFOVLargeCollider()
Test pointers are correctly enabled when interacting with colliders that are visible, but whose bounds are outside the camera FOV.
Declaration
public IEnumerator TestPointerFOVLargeCollider()
Returns
Type | Description |
---|---|
IEnumerator |
TestSpherePointerInsideGrabbable()
Tests that sphere pointer grabs object when hand is inside a giant grabbable
Declaration
public IEnumerator TestSpherePointerInsideGrabbable()
Returns
Type | Description |
---|---|
IEnumerator |