API reference
API reference
Select your platform
No SDKs available
No versions available

ShapeRecognizer Class

Extends ScriptableObject
Asset characterizing a "hand shape" which can be recognized.
Despite its name, this type does not actively recognize anything but merely stores the data, in the form of per-finger FingerFeatureConfigLists, which is needed for a ShapeRecognizerActiveState to perform the calculations needed to determine whether the described hand shape has been recognized or not. In this sense, ShapeRecognizer might be thought of as a definition or descriptor of a hand shape.

Fields

IndexFeatureConfigs : IReadOnlyList< FingerFeatureConfig >
The list of FingerFeatureConfigs which must be satisfied for the index finger to be acceptable for recognition by this ShapeRecognizer.
For an overview of the role of this list in shape recognition, see the remarks on FingerFeatureConfigList.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.IndexFeatureConfigs
MiddleFeatureConfigs : IReadOnlyList< FingerFeatureConfig >
The list of FingerFeatureConfigs which must be satisfied for the middle finger to be acceptable for recognition by this ShapeRecognizer.
For an overview of the role of this list in shape recognition, see the remarks on FingerFeatureConfigList.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.MiddleFeatureConfigs
PinkyFeatureConfigs : IReadOnlyList< FingerFeatureConfig >
The list of FingerFeatureConfigs which must be satisfied for the pinky finger to be acceptable for recognition by this ShapeRecognizer.
For an overview of the role of this list in shape recognition, see the remarks on FingerFeatureConfigList.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.PinkyFeatureConfigs
RingFeatureConfigs : IReadOnlyList< FingerFeatureConfig >
The list of FingerFeatureConfigs which must be satisfied for the ring finger to be acceptable for recognition by this ShapeRecognizer.
For an overview of the role of this list in shape recognition, see the remarks on FingerFeatureConfigList.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.RingFeatureConfigs
ShapeName : string
The human-readable name assigned to this hand shape.
Signature
string Oculus.Interaction.PoseDetection.ShapeRecognizer.ShapeName
ThumbFeatureConfigs : IReadOnlyList< FingerFeatureConfig >
The list of FingerFeatureConfigs which must be satisfied for the thumb to be acceptable for recognition by this ShapeRecognizer.
For an overview of the role of this list in shape recognition, see the remarks on FingerFeatureConfigList.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.ThumbFeatureConfigs

Methods

GetFingerFeatureConfigs ( finger )
Retrieves the list of FingerFeatureConfigs which must be satisfied for the provided finger to be acceptable for recognition by this ShapeRecognizer.
This is a equivalent to calling ThumbFeatureConfigs/IndexFeatureConfigs/etc. for the finger in question.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.GetFingerFeatureConfigs(HandFinger finger)
Parameters
finger: HandFinger  The finger for which to retrieve the list of required FingerFeatureConfigs.
Returns
IReadOnlyList< FingerFeatureConfig >  The list of required FingerFeatureConfigs for finger .
GetFingerFeatureConfigs ()
Enumerates the required FingerFeatureConfigs for each finger in this ShapeRecognizer.
This is a convenience method equivalent to calling GetFingerFeatureConfigs(HandFinger) for every finger in turn.
Signature
IEnumerable<ValueTuple<HandFinger, IReadOnlyList<FingerFeatureConfig> > > Oculus.Interaction.PoseDetection.ShapeRecognizer.GetFingerFeatureConfigs()
Returns
IEnumerable< ValueTuple< HandFinger, IReadOnlyList< FingerFeatureConfig > > >  An iterator exposing, in turn, each finger and its associated FingerFeatureConfigs as a tuple.
InjectAllShapeRecognizer ( fingerFeatureConfigs )
Sets the FingerFeatureConfigs for all fingers for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectAllShapeRecognizer(IDictionary< HandFinger, FingerFeatureConfig[]> fingerFeatureConfigs)
Parameters
fingerFeatureConfigs: IDictionary< HandFinger, FingerFeatureConfig[]>
Returns
void
InjectIndexFeatureConfigs ( configs )
Sets the FingerFeatureConfigs for the index finger for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectIndexFeatureConfigs(FingerFeatureConfig[] configs)
Parameters
configs: FingerFeatureConfig []
Returns
void
InjectMiddleFeatureConfigs ( configs )
Sets the FingerFeatureConfigs for the middle finger for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectMiddleFeatureConfigs(FingerFeatureConfig[] configs)
Parameters
configs: FingerFeatureConfig []
Returns
void
InjectPinkyFeatureConfigs ( configs )
Sets the FingerFeatureConfigs for the pinky finger for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectPinkyFeatureConfigs(FingerFeatureConfig[] configs)
Parameters
configs: FingerFeatureConfig []
Returns
void
InjectRingFeatureConfigs ( configs )
Sets the FingerFeatureConfigs for the ring finger for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectRingFeatureConfigs(FingerFeatureConfig[] configs)
Parameters
configs: FingerFeatureConfig []
Returns
void
InjectShapeName ( shapeName )
Sets the ShapeName for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectShapeName(string shapeName)
Parameters
shapeName: string
Returns
void
InjectThumbFeatureConfigs ( configs )
Sets the FingerFeatureConfigs for the thumb for a dynamically instantiated ShapeRecognizer.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.PoseDetection.ShapeRecognizer.InjectThumbFeatureConfigs(FingerFeatureConfig[] configs)
Parameters
configs: FingerFeatureConfig []
Returns
void

Inner Classes

FingerFeatureConfig Class

Extends Oculus.Interaction.PoseDetection.FeatureConfigBase< FingerFeature >
Specializes FeatureConfigBase<TFeature> (which simply stores information related to the state of a feature) for FingerFeatures.
This is used by ShapeRecognizerActiveState and other consumers of ShapeRecognizer to assess whether individual fingers are acceptably posed for recognition.

FingerFeatureConfigList Class

A serializable list of FingerFeatureConfigs, implicitly all associated with a single finger.
Each FingerFeatureConfig describes only one aspect (FingerFeature) of a finger, meaning multiple can be applicable at the same time; for example, the index finger in the "scissors" hand shape (as in "rock, paper, scissors") must have both low FingerFeature.Curl and high FingerFeature.Abduction. A FingerFeatureConfigList can thus be thought of as a list of requirements, all of which must be satisfied in order for a finger's shape to be acceptable for recognition.

Constructors

FingerFeatureConfigList ()
Constructs a FingerFeatureConfigList with an empty Value list.
Because that list is the set of all requirements which must be met for a finger to be acceptable in a ShapeRecognizer, an empty list indicates that there are no requirements and the finger is always acceptable.
Signature
Oculus.Interaction.PoseDetection.ShapeRecognizer.FingerFeatureConfigList.FingerFeatureConfigList()
FingerFeatureConfigList ( value )
Constructs a FingerFeatureConfigList with the provided value to be assigned to Value.
Signature
Oculus.Interaction.PoseDetection.ShapeRecognizer.FingerFeatureConfigList.FingerFeatureConfigList(List< FingerFeatureConfig > value)
Parameters
value: List< FingerFeatureConfig >  The list of required FingerFeatureConfigs

Fields

Value : IReadOnlyList< FingerFeatureConfig >
The list of FingerFeatureConfigs which collectively describe the requirements for a specific finger in a ShapeRecognizer.
For an overview of the role of this list in shape recognition, see the remarks on FingerFeatureConfigList.
Signature
IReadOnlyList<FingerFeatureConfig> Oculus.Interaction.PoseDetection.ShapeRecognizer.FingerFeatureConfigList.Value