LeapPointable Class Reference
Inherits from | NSObject |
Declared in | LeapObjectiveC.h |
Overview
The LeapPointable class reports the physical characteristics of a detected finger or tool.
Both fingers and tools are classified as LeapPointable objects. Use the
[LeapPointable isFinger] function to determine whether a pointable object
represents a finger. Use the [LeapPointable isTool] function to determine
whether a pointable object represents a tool. The Leap 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
logic used by the LeapPointable class is the same as that used by the Leap Motion
software for OS-level touch and mouse input emulation. The LeapPointable class reports
touch state with the touchZone and touchDistance properties.
Note that LeapPointable objects can be invalid, which means that they do not contain
valid tracking data and do not correspond to a physical entity. Invalid LeapPointable
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 LeapPointable constructor is also invalid.
Test for validity with the [LeapPointable isValid] function.
Tasks
-
– id
A unique ID assigned to this LeapPointable 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 field of view), the
Leap may assign a new ID when it detects the entity in a future frame. -
– tipPosition
The tip position in millimeters from the Leap origin.
-
– tipVelocity
The rate of change of the tip position in millimeters/second.
-
– direction
The direction in which this finger or tool is pointing.
-
– width
The estimated width of the finger or tool in millimeters.
-
– length
The estimated length of the finger or tool in millimeters.
-
– isFinger
Whether or not the LeapPointable is believed to be a finger.
Fingers are generally shorter, thicker, and less straight than tools. -
– isTool
Whether or not the LeapPointable is believed to be a tool.
Tools are generally longer, thinner, and straighter than fingers. -
– isValid
Reports whether this is a valid LeapPointable object.
-
– touchZone
The current touch zone of this LeapPointable object.
-
– touchDistance
A value proportional to the distance between this LeapPointable object and the
adaptive touch plane. -
– stabilizedTipPosition
The stabilized tip position of this LeapPointable.
-
– frame
The LeapFrame associated with this LeapPointable object.
-
– hand
The LeapHand associated with this finger or tool.
-
+ invalid
Returns an invalid LeapPointable object.
Class Methods
invalid
Returns an invalid LeapPointable object.
+ (LeapPointable *)invalid
Return Value
The invalid LeapPointable instance.
Discussion
Returns an invalid LeapPointable object.
You can use the instance returned by this function in comparisons testing
whether a given LeapPointable instance is valid or invalid. (You can also use the
LeapPointable isValid function.)
Declared In
LeapObjectiveC.h
Instance Methods
direction
The direction in which this finger or tool is pointing.
- (LeapVector *)direction
Return Value
The LeapVector pointing in the same direction as the tip of this
LeapPointable object.
Discussion
The direction in which this finger or tool is pointing.
The direction is expressed as a unit vector pointing in the same
direction as the tip.
Declared In
LeapObjectiveC.h
frame
The LeapFrame associated with this LeapPointable object.
- (LeapFrame *)frame
Return Value
The associated LeapFrame object, if available; otherwise,
an invalid LeapFrame object is returned.
Discussion
The LeapFrame associated with this LeapPointable object.
Declared In
LeapObjectiveC.h
hand
The LeapHand associated with this finger or tool.
- (LeapHand *)hand
Return Value
The associated LeapHand object, if available; otherwise,
an invalid LeapHand object is returned.
Discussion
The LeapHand associated with this finger or tool.
Declared In
LeapObjectiveC.h
id
A unique ID assigned to this LeapPointable 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 field of view), the
Leap may assign a new ID when it detects the entity in a future frame.
- (int32_t)id
Return Value
The ID assigned to this LeapPointable object.
Discussion
A unique ID assigned to this LeapPointable 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 field of view), the
Leap may assign a new ID when it detects the entity in a future frame.
Use the ID value with the [LeapFrame pointable:] function to find this
LeapPointable object in future frames.
Declared In
LeapObjectiveC.h
isFinger
Whether or not the LeapPointable is believed to be a finger.
Fingers are generally shorter, thicker, and less straight than tools.
- (BOOL)isFinger
Return Value
YES, if this LeapPointable is classified as a LeapFinger.
Discussion
Whether or not the LeapPointable is believed to be a finger.
Fingers are generally shorter, thicker, and less straight than tools.
Declared In
LeapObjectiveC.h
isTool
Whether or not the LeapPointable is believed to be a tool.
Tools are generally longer, thinner, and straighter than fingers.
- (BOOL)isTool
Return Value
YES, if this LeapPointable is classified as a LeapTool.
Discussion
Whether or not the LeapPointable is believed to be a tool.
Tools are generally longer, thinner, and straighter than fingers.
Declared In
LeapObjectiveC.h
isValid
Reports whether this is a valid LeapPointable object.
- (BOOL)isValid
Return Value
YES, if this LeapPointable object contains valid tracking data.
Discussion
Reports whether this is a valid LeapPointable object.
Declared In
LeapObjectiveC.h
length
The estimated length of the finger or tool in millimeters.
- (float)length
Return Value
The estimated length of this LeapPointable object.
Discussion
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.
Declared In
LeapObjectiveC.h
stabilizedTipPosition
The stabilized tip position of this LeapPointable.
- (LeapVector *)stabilizedTipPosition
Discussion
The stabilized tip position of this LeapPointable.
Smoothing and stabilization is performed in order to make
this value more suitable for interaction with 2D content.
Declared In
LeapObjectiveC.h
tipPosition
The tip position in millimeters from the Leap origin.
- (LeapVector *)tipPosition
Return Value
The LeapVector containing the coordinates of the tip position.
Discussion
The tip position in millimeters from the Leap origin.
Declared In
LeapObjectiveC.h
tipVelocity
The rate of change of the tip position in millimeters/second.
- (LeapVector *)tipVelocity
Return Value
The LeapVector containing the coordinates of the tip velocity.
Discussion
The rate of change of the tip position in millimeters/second.
Declared In
LeapObjectiveC.h
touchDistance
A value proportional to the distance between this LeapPointable object and the
adaptive touch plane.
- (float)touchDistance
Discussion
A value proportional to the distance between this LeapPointable object and the
adaptive touch plane.
The touch distance is a value in the range [-1, 1]. The value 1.0 indicates the
LeapPointable is at the far edge of the hovering zone. The value 0 indicates the
LeapPointable is just entering the touching zone. A value of -1.0 indicates the
LeapPointable 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 LeapPointable 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.
Declared In
LeapObjectiveC.h
touchZone
The current touch zone of this LeapPointable object.
- (LeapPointableZone)touchZone
Discussion
The current touch zone of this LeapPointable 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 interprets purposeful movements toward this plane as potential touch
points. When a LeapPointable moves close to the adaptive touch plane, it enters the
“hovering” zone. When a LeapPointable reaches or passes through the plane, it enters
the “touching” zone.
The possible states are present in the Zone enum:
- Zone.NONE – The LeapPointable is outside the hovering zone.
- Zone.HOVERING – The LeapPointable is close to, but not touching the touch plane.
- Zone.TOUCHING – The LeapPointable has penetrated the touch plane.
The touchDistance property provides a normalized indication of the distance to
the touch plane when the LeapPointable is in the hovering or touching zones.
Declared In
LeapObjectiveC.h
width
The estimated width of the finger or tool in millimeters.
- (float)width
Return Value
The estimated width of this LeapPointable object.
Discussion
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.
Declared In
LeapObjectiveC.h