The Tool class represents a tracked tool.
More...
Inherits Pointable.
|
| enum | Zone |
| | Defines the values for reporting the state of a Pointable object in relation to an adaptive touch plane. More...
|
| |
The Tool class represents a tracked tool.
- Deprecated:
- 3.0
Defines the values for reporting the state of a Pointable object in relation to an adaptive touch plane.
- Since
- 1.0
| Enumerator |
|---|
| ZONE_NONE |
The Pointable object is too far from the plane to be considered hovering or touching.
- Since
- 1.0
|
| ZONE_HOVERING |
The Pointable object is close to, but not touching the plane.
- Since
- 1.0
|
| ZONE_TOUCHING |
The Pointable has penetrated the plane.
- Since
- 1.0
|
| Tool |
( |
ToolImplementation * |
| ) |
|
If the specified Pointable object represents a tool, creates a copy of it as a Tool object; otherwise, creates an invalid Tool object.
- Deprecated:
- 3.0
The direction in which this finger is pointing.
The direction is expressed as a unit vector pointing in the same direction as the tip.
- Returns
- The Vector pointing in the same direction as the tip of this Pointable object.
- Since
- 1.0
The Frame associated with this Pointable object.
- Returns
- The associated Frame object, if available; otherwise, an invalid Frame object is returned.
- Since
- 1.0
The Hand associated with a finger.
This function always returns an invalid Hand object.
- Returns
- The associated Hand object, if available; otherwise, an invalid Hand object is returned.
- Since
- 1.0
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.
int32_t theID = pointable.
id();
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.
- Returns
- The ID assigned to this Pointable object.
- Since
- 1.0
| static const Tool& invalid |
( |
| ) |
|
|
static |
| bool isExtended |
( |
| ) |
const |
|
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.
int extendedFingers = 0;
{
}
- Returns
- True, if the pointable is extended.
- Since
- 2.0
Whether or not this Pointable is classified as a finger.
- Returns
- True, if this Pointable is classified as a finger.
- Since
- 1.0
Reports whether this is a valid Pointable object.
- Returns
- True, if this Pointable object contains valid tracking data.
- Since
- 1.0
The estimated length of the finger in millimeters.
float apparentlength = pointable.
length();
- Returns
- The estimated length of this Pointable object.
- Since
- 1.0
Compare Pointable object inequality.
thisPointable != thatPointable;
Two Pointable objects are equal if and only if both Pointable objects represent the exact same physical entities in the same frame and both Pointable objects are valid.
- Since
- 1.0
Compare Pointable object equality.
thisPointable == thatPointable;
Two Pointable objects are equal if and only if both Pointable objects represent the exact same physical entities in the same frame and both Pointable objects are valid.
- Since
- 1.0
| Vector stabilizedTipPosition |
( |
| ) |
const |
|
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.
- Returns
- A modified tip position of this Pointable object with some additional smoothing and stabilization applied.
- Since
- 1.0
| float timeVisible |
( |
| ) |
const |
|
inherited |
The duration of time this Pointable has been visible to the Leap Motion Controller.
- Returns
- The duration (in seconds) that this Pointable has been tracked.
- Since
- 1.0
The tip position in millimeters from the Leap Motion origin.
- Returns
- The Vector containing the coordinates of the tip position.
- Since
- 1.0
The rate of change of the tip position in millimeters/second.
- Returns
- The Vector containing the coordinates of the tip velocity.
- Since
- 1.0
| std::string toString |
( |
| ) |
const |
|
inline |
A string containing a brief, human readable description of the Tool object.
- Returns
- A description of the Tool object as a string.
- Deprecated:
- 3.0
| float touchDistance |
( |
| ) |
const |
|
inherited |
A value proportional to the distance between this Pointable object and the adaptive touch plane.
if (distance > 0) {
} else {
}
- Returns
- The normalized touch distance of this Pointable object.
- Deprecated:
- 3.0
The estimated width of the finger in millimeters.
float averageThickness = pointable.
width();
- Returns
- The estimated width of this Pointable object.
- Since
- 1.0