![]() |
Leap Motion Java API Reference
0.8.0
|
The Pointable class reports the physical characteristics of a detected finger or tool. More...
Inherits com.leapmotion.leap.Interface.
Inherited by com.leapmotion.leap.Finger, and com.leapmotion.leap.Tool.
Classes | |
enum | Zone |
Defines the values for reporting the state of a Pointable object in relation to an adaptive touch plane. More... | |
Public Member Functions | |
Vector | direction () |
The direction in which this finger or tool is pointing. | |
boolean | equals (Pointable arg0) |
Compare Pointable object equality. | |
Frame | frame () |
The Frame associated with this Pointable object. | |
Hand | hand () |
The Hand associated with this finger or tool. | |
int | id () |
A unique ID assigned to this Pointable object, whose value remains the same across consecutive frames while the tracked finger or tool remains visible. | |
boolean | isFinger () |
Whether or not the Pointable is believed to be a finger. | |
boolean | isTool () |
Whether or not the Pointable is believed to be a tool. | |
boolean | isValid () |
Reports whether this is a valid Pointable object. | |
float | length () |
The estimated length of the finger or tool in millimeters. | |
Pointable () | |
Constructs a Pointable object. | |
Vector | stabilizedTipPosition () |
The stabilized tip position of this Pointable. | |
Vector | tipPosition () |
The tip position in millimeters from the Leap Motion origin. | |
Vector | tipVelocity () |
The rate of change of the tip position in millimeters/second. | |
String | toString () |
A string containing a brief, human readable description of the Pointable object. | |
float | touchDistance () |
A value proportional to the distance between this Pointable object and the adaptive touch plane. | |
Pointable.Zone | touchZone () |
The current touch zone of this Pointable object. | |
float | width () |
The estimated width of the finger or tool in millimeters. | |
Static Public Member Functions | |
static Pointable | invalid () |
Returns an invalid Pointable object. | |
The Pointable class reports the physical characteristics of a detected finger or tool.
Both fingers and tools are classified as Pointable objects. Use the Pointable::isFinger() function to determine whether a Pointable object represents a finger. Use the Pointable::isTool() function to determine whether a Pointable object represents a tool. The Leap Motion software classifies a detected entity as a tool when it is thinner, straighter, and longer than a typical finger.
To provide touch emulation, the Leap Motion software associates a floating touch plane that adapts to the user's finger movement and hand posture. The Leap Motion interprets purposeful movements toward this plane as potential touch points. The Pointable class reports touch state with the touchZone and touchDistance values.
Note that Pointable objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical entity. Invalid Pointable objects can be the result of asking for a Pointable object using an ID from an earlier frame when no Pointable objects with that ID exist in the current frame. A Pointable object created from the Pointable constructor is also invalid. Test for validity with the Pointable::isValid() function.
com.leapmotion.leap.Pointable.Pointable | ( | ) |
Vector com.leapmotion.leap.Pointable.direction | ( | ) |
boolean com.leapmotion.leap.Pointable.equals | ( | Pointable | arg0 | ) |
Frame com.leapmotion.leap.Pointable.frame | ( | ) |
Hand com.leapmotion.leap.Pointable.hand | ( | ) |
int com.leapmotion.leap.Pointable.id | ( | ) |
A unique ID assigned to this Pointable object, whose value remains the same across consecutive frames while the tracked finger or tool 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 device 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.
|
static |
Returns an invalid Pointable object.
You can use the instance returned by this function in comparisons testing whether a given Pointable instance is valid or invalid. (You can also use the Pointable::isValid() function.)
boolean com.leapmotion.leap.Pointable.isFinger | ( | ) |
boolean com.leapmotion.leap.Pointable.isTool | ( | ) |
boolean com.leapmotion.leap.Pointable.isValid | ( | ) |
float com.leapmotion.leap.Pointable.length | ( | ) |
The estimated length of the finger or tool in millimeters.
The reported length is the visible length of the finger or tool from the hand to tip. If the length isn't known, then a value of 0 is returned.
Vector com.leapmotion.leap.Pointable.stabilizedTipPosition | ( | ) |
Vector com.leapmotion.leap.Pointable.tipPosition | ( | ) |
The tip position in millimeters from the Leap Motion origin.
Vector com.leapmotion.leap.Pointable.tipVelocity | ( | ) |
The rate of change of the tip position in millimeters/second.
String com.leapmotion.leap.Pointable.toString | ( | ) |
float com.leapmotion.leap.Pointable.touchDistance | ( | ) |
A value proportional to the distance between this Pointable object and the adaptive touch plane.
The touch distance is a value in the range [-1, 1]. The value 1.0 indicates the Pointable is at the far edge of the hovering zone. The value 0 indicates the Pointable is just entering the touching zone. A value of -1.0 indicates the Pointable is firmly within the touching zone. Values in between are proportional to the distance from the plane. Thus, the touchDistance of 0.5 indicates that the Pointable is halfway into the hovering zone.
You can use the touchDistance value to modulate visual feedback given to the user as their fingers close in on a touch target, such as a button.
Pointable.Zone com.leapmotion.leap.Pointable.touchZone | ( | ) |
The current touch zone of this Pointable object.
The Leap Motion software computes the touch zone based on a floating touch plane that adapts to the user's finger movement and hand posture. The Leap Motion software interprets purposeful movements toward this plane as potential touch points. When a Pointable moves close to the adaptive touch plane, it enters the "hovering" zone. When a Pointable reaches or passes through the plane, it enters the "touching" zone.
The possible states are present in the Zone enum of this class:
The touchDistance value provides a normalized indication of the distance to the touch plane when the Pointable is in the hovering or touching zones.
float com.leapmotion.leap.Pointable.width | ( | ) |
The estimated width of the finger or tool in millimeters.
The reported width is the average width of the visible portion of the finger or tool from the hand to the tip. If the width isn't known, then a value of 0 is returned.