FingerΒΆ

The Finger class represents a tracked finger. More...

Inherits Pointable.

Classes

enum  Joint
 Deprecated as of version 2.0. More...
 
enum  Type
 Enumerates the names of the fingers. More...
 

Public Member Functions

Bone bone (Bone.Type boneIx)
 The bone at a given bone index on this finger. More...
 
 Finger ()
 Constructs a Finger object. More...
 
 Finger (Pointable arg0)
 If the specified Pointable object represents a finger, creates a copy of it as a Finger object; otherwise, creates an invalid Finger object. More...
 
Vector jointPosition (Finger.Joint jointIx)
 Deprecated as of version 2.0 Use 'bone' method instead. More...
 
String toString ()
 A string containing a brief, human readable description of the Finger object. More...
 
Finger.Type type ()
 The name of this finger. More...
 
- Public Member Functions inherited from Pointable
Vector direction ()
 The direction in which this finger is pointing. More...
 
boolean equals (Pointable arg0)
 Compare Pointable object equality. More...
 
Frame frame ()
 The Frame associated with this Pointable object. More...
 
Hand hand ()
 The Hand associated with a finger. More...
 
int id ()
 A unique ID assigned to this Pointable object, whose value remains the same across consecutive frames while the tracked finger remains visible. More...
 
boolean isExtended ()
 Whether or not this Pointable is in an extended posture. More...
 
boolean isFinger ()
 Whether or not this Pointable is classified as a finger. More...
 
boolean isTool ()
 Whether or not this Pointable is classified as a tool. More...
 
boolean isValid ()
 Reports whether this is a valid Pointable object. More...
 
float length ()
 The estimated length of the finger in millimeters. More...
 
 Pointable ()
 Constructs a Pointable object. More...
 
Vector stabilizedTipPosition ()
 The stabilized tip position of this Pointable. More...
 
float timeVisible ()
 The duration of time this Pointable has been visible to the Leap Motion Controller. More...
 
Vector tipPosition ()
 The tip position in millimeters from the Leap Motion origin. More...
 
Vector tipVelocity ()
 The rate of change of the tip position in millimeters/second. More...
 
String toString ()
 A string containing a brief, human readable description of the Pointable object. More...
 
float touchDistance ()
 A value proportional to the distance between this Pointable object and the adaptive touch plane. More...
 
Pointable.Zone touchZone ()
 The current touch zone of this Pointable object. More...
 
float width ()
 The estimated width of the finger in millimeters. More...
 

Static Public Member Functions

static Finger invalid ()
 Returns an invalid Finger object. More...
 
- Static Public Member Functions inherited from Pointable
static Pointable invalid ()
 Returns an invalid Pointable object. More...
 

Detailed Description

The Finger class represents a tracked finger.

Fingers are Pointable objects that the Leap Motion software has classified as a finger. Get valid Finger objects from a Frame or a Hand object.

Fingers may be permanently associated to a hand. In this case the angular order of the finger IDs will be invariant. As fingers move in and out of view it is possible for the guessed ID of a finger to be incorrect. Consequently, it may be necessary for finger IDs to be exchanged. All tracked properties, such as velocity, will remain continuous in the API. However, quantities that are derived from the API output (such as a history of positions) will be discontinuous unless they have a corresponding ID exchange.

Note that Finger objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical finger. Invalid Finger objects can be the result of asking for a Finger object using an ID from an earlier frame when no Finger objects with that ID exist in the current frame. A Finger object created from the Finger constructor is also invalid. Test for validity with the Finger::isValid() function.

Since
1.0

Constructor & Destructor Documentation

Finger ( )

Constructs a Finger object.

An uninitialized finger is considered invalid. Get valid Finger objects from a Frame or a Hand object.

Since
1.0
Finger ( Pointable  arg0)

If the specified Pointable object represents a finger, creates a copy of it as a Finger object; otherwise, creates an invalid Finger object.

Finger finger = new Finger(pointableObject);
Since
1.0

Member Function Documentation

Bone bone ( Bone.Type  boneIx)

The bone at a given bone index on this finger.

for (Finger finger : hand.fingers()) {
for(Bone.Type boneType : Bone.Type.values()) {
Bone bone = finger.bone(boneType);
// ... Use the bone
}
}
Parameters
boneIxAn index value from the Bone::Type enumeration identifying the bone of interest.
Returns
The Bone that has the specified bone type.
Since
2.0
static Finger invalid ( )
static

Returns an invalid Finger object.

You can use the instance returned by this function in comparisons testing whether a given Finger instance is valid or invalid. (You can also use the Finger::isValid() function.)

Finger invalidFinger = Finger.invalid();
Returns
The invalid Finger instance.
Since
1.0
Vector jointPosition ( Finger.Joint  jointIx)

Deprecated as of version 2.0 Use 'bone' method instead.

String toString ( )

A string containing a brief, human readable description of the Finger object.

String description = finger.toString();
Returns
A description of the Finger object as a string.
Since
1.0
Finger.Type type ( )

The name of this finger.

Finger.Type fingerType = finger.type();
Returns
The anatomical type of this finger as a member of the Finger::Type enumeration.
Since
2.0