LeapJS API Reference
Class

Leap.Pointable

Contents

class Leap.Pointable

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.tool property to determine whether a Pointable object represents a tool or finger. The Leap classifies a detected entity as a tool when it is thinner, straighter, and longer than a typical finger.

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.valid property.

Constructor Top

  Pointable ()

Static Properties & Enumerations Top

Leap.Pointable Invalid

Properties Top

Leap.Vector direction
String id
Number length
Leap.Vector tipPosition
Leap.Vector tipVelocity
Boolean tool
Boolean valid
Number width

Methods Top

String toString ()

Constructor details Top

pointable.js at line 3
Pointable ()

Constructs a Pointable object.

An uninitialized pointable is considered invalid. Get valid Pointable objects from a Frame or a Hand object.

Static Properties & Enumerations Detail Top

pointable.js at line 136
static public Leap.Pointable Invalid

An invalid Pointable object.

You can use this Pointable instance in comparisons testing whether a given Pointable instance is valid or invalid. (You can also use the Pointable.valid property.)

Properties Detail Top

pointable.js at line 90
public Leap.Vector direction

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.

Finger

pointable.js at line 37
public String 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 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 pointable() functions defined for the Frame and Frame.Hand classes to find this Pointable object in future frames.

pointable.js at line 54
public Number 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.

pointable.js at line 102
public Leap.Vector tipPosition

The tip position in millimeters from the Leap origin.

pointable.js at line 110
public Leap.Vector tipVelocity

The rate of change of the tip position in millimeters/second.

pointable.js at line 65
public Boolean tool

Whether or not the Pointable is believed to be a tool. Tools are generally longer, thinner, and straighter than fingers.

If tool is false, then this Pointable must be a finger.

pointable.js at line 29
public Boolean valid

Indicates whether this is a valid Pointable object.

pointable.js at line 76
public Number width

The estimated width of the tool in millimeters.

The reported width is the average width of the visible portion of the tool from the hand to the tip. If the width isn't known, then a value of 0 is returned.

Pointable objects representing fingers do not have a width property.

Methods Detail Top

pointable.js at line 120
public String toString ()

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

Return Value

String

A description of the Pointable object as a string.