Class GazeHandHelper
This class must be instantiated by a script that implements the IMixedRealitySourceStateHandler, IMixedRealityInputHandler and IMixedRealityInputHandler<T>.
It must receive EventData arguments from OnInputDown(), OnInputUp(), OnInputChanged() and OnSourceLost().
This class manages the states of input necessary to calculate a proper grab position The eventData received on inputdown has the point on the target that was hit by the gaze; the mixedrealitypose - eventdata received on input changed contains the handposition in eventdata.inputdata.position It also contains useful retrieval functions.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.UI
Assembly: cs.temp.dll.dll
Syntax
[Obsolete("This component is no longer supported", true)]
public class GazeHandHelper
Methods
AddSource(InputEventData)
This function must be called from the OnInputDown handler in a script implementing the IMixedRealityInputHandler<T>.
Declaration
public void AddSource(InputEventData eventData)
Parameters
| Type | Name | Description |
|---|---|---|
| InputEventData | eventData | The InputEventData argument 'eventData' is passed through to GazeHandHelper |
GetActiveHandCount()
This function returns the number of active hands.
Declaration
public int GetActiveHandCount()
Returns
| Type | Description |
|---|---|
| Int32 |
GetAllHandPositions()
This function gets an array of all active hand positions
Declaration
public IEnumerable<Vector3> GetAllHandPositions()
Returns
| Type | Description |
|---|---|
| IEnumerable<Vector3> | enumerable of Vector3 |
GetFirstHand()
This function retrieves the position of the first active hand.
Declaration
public Vector3 GetFirstHand()
Returns
| Type | Description |
|---|---|
| Vector3 | Vector3 representing position |
GetHandPositionsDictionary()
This function retrieves a reference to the Dictionary that maps hand positions to sourceIds. This return value is NOT filtered for whether the hands are active. User should check first using GetActiveHandCount().
Declaration
public Dictionary<uint, Vector3> GetHandPositionsDictionary()
Returns
| Type | Description |
|---|---|
| Dictionary<UInt32, Vector3> | Dictionary with uint Keys mapping to Vector3 positions |
GetHandsCentroid()
This function gets the average of the positions of all active hands.
Declaration
public Vector3 GetHandsCentroid()
Returns
| Type | Description |
|---|---|
| Vector3 | Vector3 representing the average position |
RemoveSource(InputEventData)
This function must be called from the OnInputUp handler in a script implementing the IMixedRealityInputHandler<T>.
Declaration
public void RemoveSource(InputEventData eventData)
Parameters
| Type | Name | Description |
|---|---|---|
| InputEventData | eventData | he InputEventData argument 'eventData' is passed through to GazeHandHelper |
RemoveSource(SourceStateEventData)
This function must be called from the OnSourceLost handler in a script implementing the IMixedRealitySourceStateHandler interface.
Declaration
public void RemoveSource(SourceStateEventData eventData)
Parameters
| Type | Name | Description |
|---|---|---|
| SourceStateEventData | eventData |
TryGetHandPosition(Handedness, out Vector3)
TryGet style function to return HandPosition of a certain handedness if available.
Declaration
public bool TryGetHandPosition(Handedness handedness, out Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Handedness | handedness | asks for left or right hand or either |
| Vector3 | position | out value that gets filled with a Vector3 representing position |
Returns
| Type | Description |
|---|---|
| Boolean | true or false- whether the hand existed |
TryGetHandPosition(UInt32, out Vector3)
TryGet style function to return HandPosition of a certain sourceId if available.
Declaration
public bool TryGetHandPosition(uint id, out Vector3 handPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | id | asks for the hand position associated with a certain IMixedRealityInputSource id |
| Vector3 | handPosition | out value that gets filled with a Vector3 representing position |
Returns
| Type | Description |
|---|---|
| Boolean | true or false- whether the hand existed |
TryGetHandsCentroid(out Vector3)
TryGet style function to get the average of all active hand positions.
Declaration
public bool TryGetHandsCentroid(out Vector3 handsCentroid)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | handsCentroid | out value filled with Vector3 representing average of hand positions |
Returns
| Type | Description |
|---|---|
| Boolean | true if there were any active hands; false if there were no active hands |
UpdateSource(InputEventData<MixedRealityPose>)
This function must be called from the OnInputChanged handler in a script implementing the IMixedRealityInputHandler<T>.
Declaration
public void UpdateSource(InputEventData<MixedRealityPose> eventData)
Parameters
| Type | Name | Description |
|---|---|---|
| InputEventData<MixedRealityPose> | eventData |