Class TestHand
Utility class to use a simulated hand
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Tests
Assembly: cs.temp.dll.dll
Syntax
public class TestHand
Constructors
TestHand(Handedness)
Declaration
public TestHand(Handedness handedness)
Parameters
Type | Name | Description |
---|---|---|
Handedness | handedness |
Methods
Click()
Combined sequence of pinching and unpinching
Declaration
public IEnumerator Click()
Returns
Type | Description |
---|---|
IEnumerator |
GetPointer<T>()
Returns the first pointer of given type that is associated with this hand.
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()
Returns the velocity of the simulated hand
Declaration
public Vector3 GetVelocity()
Returns
Type | Description |
---|---|
Vector3 |
GrabAndThrowAt(Vector3, Boolean, Int32)
Combined sequence of pinching, moving, and releasing.
Declaration
public IEnumerator GrabAndThrowAt(Vector3 positionToRelease, bool waitForFinalFixedUpdate, int numSteps = 30)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | positionToRelease | The position to which the hand moves while pinching |
Boolean | waitForFinalFixedUpdate | Wait for a final physics update after releasing |
Int32 | numSteps | Number of steps of the hand movement |
Returns
Type | Description |
---|---|
IEnumerator |
Hide(Boolean)
Hide the hand
Declaration
public 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 hand by some given delta.
Declaration
public IEnumerator Move(Vector3 delta, int numSteps = -1)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | delta | Amount to move the hand 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.HandMoveStepsSentinelValue |
Returns
Type | Description |
---|---|
IEnumerator |
MoveTo(Vector3, Int32, Boolean)
Moves hand to given position over some number of frames.
Declaration
public IEnumerator MoveTo(Vector3 newPosition, int numSteps = -1, bool waitForFixedUpdate = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | newPosition | Where to move hand 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.HandMoveStepsSentinelValue |
Boolean | waitForFixedUpdate | If true, waits a physics frame after moving the hand |
Returns
Type | Description |
---|---|
IEnumerator |
SetGesture(ArticulatedHandPose.GestureId, Boolean)
Changes the hand's pose to the given gesture. Does not animate the hand between the current pose and new pose.
Declaration
public IEnumerator SetGesture(ArticulatedHandPose.GestureId newGestureId, bool waitForFixedUpdate = true)
Parameters
Type | Name | Description |
---|---|---|
ArticulatedHandPose.GestureId | newGestureId | The new hand pose |
Boolean | waitForFixedUpdate | If true, waits for a fixed update after moving to the new pose. |
Returns
Type | Description |
---|---|
IEnumerator |
SetRotation(Quaternion, Int32)
Rotates the hand to new rotation.
Declaration
public IEnumerator SetRotation(Quaternion newRotation, int numSteps = -1)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | newRotation | New rotation of hand |
Int32 | numSteps | Number of frames to rotate over. |
Returns
Type | Description |
---|---|
IEnumerator |
Show(Vector3, Boolean)
Show the hand at a specified position
Declaration
public IEnumerator Show(Vector3 position, bool waitForFixedUpdate = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Where to show the hand |
Boolean | waitForFixedUpdate | If true, will wait for a physics frame after showing the hand. |
Returns
Type | Description |
---|---|
IEnumerator |