Class XRFingerShapeMath
Extension methods for XRHand to calculate the
XRFinger
Inherited Members
Namespace: UnityEngine .XR.Hands.Gestures
Assembly: Unity.XR.Hands.dll
Syntax
public static class XRFingerShapeMath
Methods
CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes)
Calculate values useful for pose detection for a single finger. Will
only calculate fields of XRFingershapeTypes
.
Declaration
public static XRFingerShape CalculateFingerShape(this XRHand xrHand, XRHandFingerID fingerID, XRFingerShapeTypes shapeTypes)
Parameters
Type | Name | Description |
---|---|---|
XRHand | xrHand | The XRHand from which to get finger joint data. |
XRHand |
fingerID | Denotes which finger to calculate XRFingerState values for. |
XRFinger |
shapeTypes | Denotes which fields to calculate in the returned
XRFinger |
Returns
Type | Description |
---|---|
XRFinger |
Returns an XRFinger |
Remarks
Calling this overload will use a XRFinger
CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes, XRFingerShapeConfiguration)
Calculate values useful for pose detection for a single finger. Will
only calculate fields of XRFingershapeTypes
.
Declaration
public static XRFingerShape CalculateFingerShape(this XRHand xrHand, XRHandFingerID fingerID, XRFingerShapeTypes shapeTypes, XRFingerShapeConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
XRHand | xrHand | The XRHand from which to get finger joint data. |
XRHand |
fingerID | Denotes which finger to calculate XRFinger |
XRFinger |
shapeTypes | Denotes which fields to calculate in the returned XRFinger |
XRFinger |
configuration | The configuration used to convert joint data to finger state values. |
Returns
Type | Description |
---|---|
XRFinger |
Returns an XRFinger |
ResetFingerShapeConfiguration(XRHandFingerID)
Resets the finger state configuration to default for all future calls to XRFingerStateMathUtilities.CalculateFingerStates for the given finger.
Declaration
public static void ResetFingerShapeConfiguration(XRHandFingerID fingerID)
Parameters
Type | Name | Description |
---|---|---|
XRHand |
fingerID | Which finger to reset the XRFinger |
Remarks
If you wish to override the default, call Set
SetFingerShapeConfiguration(XRHandFingerID, XRFingerShapeConfiguration)
Set the finger state configuration to use for all future calls to XRFingerStateMathUtilities.CalculateFingerStates for the given finger.
Declaration
public static void SetFingerShapeConfiguration(XRHandFingerID fingerID, XRFingerShapeConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
XRHand |
fingerID | Which finger to set the XRFinger |
XRFinger |
configuration | The configurations for the given finger. If null, that finger's configuration will revert to an appropriate default. |
Remarks
If you wish to restore the default, call Reset
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |