Class TestController
Utility class to use a simulated controller
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Tests
Assembly: cs.temp.dll.dll
Syntax
public abstract class TestController
Constructors
TestController(Handedness)
Declaration
public TestController(Handedness handedness)
Parameters
Type | Name | Description |
---|---|---|
Handedness | handedness |
Fields
handedness
Declaration
protected Handedness handedness
Field Value
Type | Description |
---|---|
Handedness |
position
Declaration
protected Vector3 position
Field Value
Type | Description |
---|---|
Vector3 |
rotation
Declaration
protected Quaternion rotation
Field Value
Type | Description |
---|---|
Quaternion |
simulationService
Declaration
protected InputSimulationService simulationService
Field Value
Type | Description |
---|---|
InputSimulationService |
Methods
Click()
Perform a sequence of actions that represent a click for the controller
Declaration
public abstract IEnumerator Click()
Returns
Type | Description |
---|---|
IEnumerator |
GetPointer<T>()
Return the first pointer of given type that is associated with this controller
Declaration
public T GetPointer<T>()
where T : class, IMixedRealityPointer
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | Type of pointer to look for. |
GetVelocity()
Return the velocity of the simulated controller
Declaration
public Vector3 GetVelocity()
Returns
Type | Description |
---|---|
Vector3 |
Hide(Boolean)
Hide the controller
Declaration
public abstract IEnumerator Hide(bool waitForFixedUpdate = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | waitForFixedUpdate | If true, will wait a physics frame after hiding |
Returns
Type | Description |
---|---|
IEnumerator |
Move(Vector3, Int32)
Move the controller by some given delta
Declaration
public abstract IEnumerator Move(Vector3 delta, int numSteps = -1)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | delta | Amount to move the controller by. |
Int32 | numSteps | How many frames to move over. This defaults to the "sentinel" value which tells the system to use the default number of steps. For more information on this value, see Microsoft.MixedReality.Toolkit.Tests.PlayModeTestUtilities.ControllerMoveStepsSentinelValue |
Returns
Type | Description |
---|---|
IEnumerator |
MoveTo(Vector3, Int32, Boolean)
Move controller to given position over some number of frames
Declaration
public abstract IEnumerator MoveTo(Vector3 newPosition, int numSteps = -1, bool waitForFixedUpdate = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | newPosition | Where to move controller to |
Int32 | numSteps | How many frames to move over. This defaults to the "sentinel" value which tells the system to use the default number of steps. For more information on this value, see Microsoft.MixedReality.Toolkit.Tests.PlayModeTestUtilities.ControllerMoveStepsSentinelValue |
Boolean | waitForFixedUpdate | If true, waits a physics frame after moving the controller |
Returns
Type | Description |
---|---|
IEnumerator |
SetRotation(Quaternion, Int32)
Rotate the controller to new rotation
Declaration
public abstract IEnumerator SetRotation(Quaternion newRotation, int numSteps = -1)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | newRotation | New rotation of controller |
Int32 | numSteps | Number of frames to rotate over. |
Returns
Type | Description |
---|---|
IEnumerator |
Show(Vector3, Boolean)
Show the controller at a specified position
Declaration
public abstract IEnumerator Show(Vector3 position, bool waitForFixedUpdate = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Where to show the controller |
Boolean | waitForFixedUpdate | If true, will wait for a physics frame after showing the controller. |
Returns
Type | Description |
---|---|
IEnumerator |