The Finger class represents a tracked finger. More...
Inherits Pointable.
Public Types | |
enum | Joint |
Deprecated as of version 2.0. More... | |
enum | Type |
Enumerates the names of the fingers. More... | |
enum | Zone |
Defines the values for reporting the state of a Pointable object in relation to an adaptive touch plane. More... | |
Public Member Functions | |
Bone | bone (Bone::Type boneIx) const |
The bone at a given bone index on this finger. More... | |
Vector | direction () const |
The direction in which this finger is pointing. More... | |
Finger (FingerImplementation *) | |
Finger () | |
Constructs a Finger object. More... | |
Finger (const Pointable &) | |
If the specified Pointable object represents a finger, creates a copy of it as a Finger object; otherwise, creates an invalid Finger object. More... | |
Frame | frame () const |
The Frame associated with this Pointable object. More... | |
Hand | hand () const |
The Hand associated with a finger. More... | |
int32_t | id () const |
A unique ID assigned to this Pointable object, whose value remains the same across consecutive frames while the tracked finger remains visible. More... | |
bool | isExtended () const |
Whether or not this Pointable is in an extended posture. More... | |
bool | isFinger () const |
Whether or not this Pointable is classified as a finger. More... | |
bool | isTool () const |
Whether or not this Pointable is classified as a tool. More... | |
bool | isValid () const |
Reports whether this is a valid Pointable object. More... | |
Vector | jointPosition (Joint jointIx) const |
Deprecated as of version 2.0 Use 'bone' method instead. More... | |
float | length () const |
The estimated length of the finger in millimeters. More... | |
bool | operator!= (const Pointable &) const |
Compare Pointable object inequality. More... | |
bool | operator== (const Pointable &) const |
Compare Pointable object equality. More... | |
Vector | stabilizedTipPosition () const |
The stabilized tip position of this Pointable. More... | |
float | timeVisible () const |
The duration of time this Pointable has been visible to the Leap Motion Controller. More... | |
Vector | tipPosition () const |
The tip position in millimeters from the Leap Motion origin. More... | |
Vector | tipVelocity () const |
The rate of change of the tip position in millimeters/second. More... | |
std::string | toString () const |
A string containing a brief, human readable description of the Finger object. More... | |
float | touchDistance () const |
A value proportional to the distance between this Pointable object and the adaptive touch plane. More... | |
Zone | touchZone () const |
The current touch zone of this Pointable object. More... | |
Type | type () const |
The name of this finger. More... | |
float | width () const |
The estimated width of the finger in millimeters. More... | |
Static Public Member Functions | |
static const Finger & | invalid () |
Returns an invalid Finger object. More... | |
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.
enum Joint |
enum Type |
Enumerates the names of the fingers.
Members of this enumeration are returned by Finger::type() to identify a Finger object.
Enumerator | |
---|---|
TYPE_THUMB |
The thumb. |
TYPE_INDEX |
The index or fore-finger. |
TYPE_MIDDLE |
The middle finger. |
TYPE_RING |
The ring finger. |
TYPE_PINKY |
The pinky or little finger. |
|
inherited |
Defines the values for reporting the state of a Pointable object in relation to an adaptive touch plane.
Enumerator | |
---|---|
ZONE_NONE |
The Pointable object is too far from the plane to be considered hovering or touching.
|
ZONE_HOVERING |
The Pointable object is close to, but not touching the plane.
|
ZONE_TOUCHING |
The Pointable has penetrated the plane.
|
Finger | ( | FingerImplementation * | ) |
Finger | ( | ) |
If the specified Pointable object represents a finger, creates a copy of it as a Finger object; otherwise, creates an invalid Finger object.
Bone bone | ( | Bone::Type | boneIx | ) | const |
The bone at a given bone index on this finger.
boneIx | An index value from the Bone::Type enumeration identifying the bone of interest. |
|
inherited |
The direction in which this finger is pointing.
The direction is expressed as a unit vector pointing in the same direction as the tip.
|
inherited |
The Frame associated with this Pointable object.
|
inherited |
The Hand associated with a finger.
This function always returns an invalid Hand object.
|
inherited |
A unique ID assigned to this Pointable object, whose value remains the same across consecutive frames while the tracked finger remains visible.
If tracking is lost (for example, when a finger is occluded by another finger or when it is withdrawn from the Leap Motion Controller field of view), the Leap Motion software may assign a new ID when it detects the entity in a future frame.
Use the ID value with the Frame::pointable() function to find this Pointable object in future frames.
IDs should be from 1 to 100 (inclusive). If more than 100 objects are tracked an IDs of -1 will be used until an ID in the defined range is available.
|
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.)
|
inherited |
Whether or not this Pointable is in an extended posture.
A finger is considered extended if it is extended straight from the hand as if pointing. A finger is not extended when it is bent down and curled towards the palm.
|
inherited |
Whether or not this Pointable is classified as a finger.
|
inherited |
Whether or not this Pointable is classified as a tool.
|
inherited |
|
inherited |
The estimated length of the finger in millimeters.
|
inherited |
|
inherited |
|
inherited |
The stabilized tip position of this Pointable.
Smoothing and stabilization is performed in order to make this value more suitable for interaction with 2D content. The stabilized position lags behind the tip position by a variable amount, depending primarily on the speed of movement.
|
inherited |
The duration of time this Pointable has been visible to the Leap Motion Controller.
|
inherited |
The tip position in millimeters from the Leap Motion origin.
|
inherited |
The rate of change of the tip position in millimeters/second.
|
inline |
|
inherited |
A value proportional to the distance between this Pointable object and the adaptive touch plane.
|
inherited |
The current touch zone of this Pointable object.
Type type | ( | ) | const |
The name of this finger.
|
inherited |
The estimated width of the finger in millimeters.