FingerPose Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a constraint describing the flexion and pointing direction of a subset of fingers.
public class FingerPose : Microsoft.Gestures.HandPartPose<Microsoft.Gestures.FingersContext>
- Inheritance
Remarks
A FingerPose constraint refers to a set of fingers, defined by the Context property, it specifies the direction of these fingers, as defined by the Direction property, and their flexion state (the degree to which a fingers is open or folded), as defined by the Flexion property. Note that when the Direction value is set to Undefined, the constraint implies no restriction of the direction for fingers mentioned in Context.
The following code defines a HandPose with a single FingerPose constraint that is actualized when both the index and thumb fingers are open and pointing forward:
var myPose = new HandPose("MyPose", new FingerPose(new[] {Finger.Index, Finger.Thumb}, FingerFlexion.Open, PoseDirection.Forward));
The FingerPose constraint in the example above restricts the pose of only the index and thumb fingers. As soon as the camera sees a hand whose index and thumb fingers are open and pointing forward, the encompassing Gesture object's state-machine can advance to myPose
, regardless of the state of the other fingers. To generalize, all the fingers which are not participating in the Context of a FingerPose are free to assume any state of flexion and point in any direction (unless constrained by a different FingerPose instance).
Note that specifying a FingerPose constraint with a Flexion value of Folded (or FoldedTucked) and in parallel a Direction value other than Undefined is ill-advised. This is because a folded finger cannot be meaningfully said to point in any particular direction. In addition, the tips of folded fingers are very likely to be hidden from the camera, making the estimated values of their directions unreliable.
Note that FingerPose instances are mutable until the containing Gesture object is registered with the gestures runtime, at which point it becomes frozen and cannot be modified any longer.
Constructors
FingerPose() |
Creates a blank FingerPose constraint. In order to obtain a meaningful constraint, the values of Context, Direction and\or Flexion would have to be set manually. |
FingerPose(Finger, FingerFlexion, PoseDirection) |
Creates a new FingerPose constraint which requires |
FingerPose(Finger, PoseDirection) |
Creates a new FingerPose constraint which requires |
FingerPose(FingersContext, FingerFlexion, PoseDirection) |
Creates a new FingerPose constraint which requires the fingers indicated by |
FingerPose(FingersContext, PoseDirection) |
Creates a new FingerPose constraint which requires the fingers indicated by |
FingerPose(IEnumerable<Finger>, FingerFlexion, PoseDirection) |
Creates a new FingerPose constraint which requires each of the given |
FingerPose(IEnumerable<Finger>, PoseDirection) |
Creates a new FingerPose constraint which requires each of the given |
Fields
DefaultPoseDirection | (Inherited from HandPartPose<ContextType>) |
Properties
Context |
Indicates which parts of the hand this constraint refers to: either SingleHandContext, AnyHandContext or AllHandsContext in case for a PalmPose constraint and either SingleFingerContext, AnyFingerContext or AllFingersContext for a FingerPose constraint. (Inherited from HandPartPose<ContextType>) |
Direction |
The direction of this hand part: Either the palm normal in case of a PalmPose or the direction at which the fingers are pointing in case of a FingerPose. (Inherited from HandPartPose<ContextType>) |
Flexion |
Specifies the FingerFlexion state (the degree to which a finger is open or folded) which will be associated with the fingers indicated by Context. |
IsFrozen | (Inherited from GesturesFrameworkObject) |
Methods
CalculateHashCode() | |
DeepFreeze() | (Inherited from HandPartPose<ContextType>) |
Equals(Object) | (Inherited from GesturesFrameworkObject) |
EqualsInternal(Object) | |
Freeze() | (Inherited from GesturesFrameworkObject) |
GetHashCode() | (Inherited from GesturesFrameworkObject) |
ToString() |
Returns a String representation of this FingerPose constraint. |
ValidateCore() | |
VerifyNotFrozen(String) | (Inherited from GesturesFrameworkObject) |
Explicit Interface Implementations
IValidatable.Validate() | (Inherited from GesturesFrameworkObject) |