NSArray(LeapPointableOrHandList)ΒΆ

NSArray(LeapPointableOrHandList) Category Reference

The LeapPointableOrHandList category provides methods for getting objects from an NSArray containing LeapPointable, LeapFinger, or LeapHand objects based on their physical position within the Leap coordinate system. More...

Instance Methods

(NSArray *) - extended
 Returns a new list containing those members of the current list that are extended. More...
 
(NSArray *) - fingerType:
 Returns a new list containing those Pointable objects in the current list that are of the specified finger type. More...
 
(id) - frontmost
 The member of the list that is farthest to the front within the standard Leap frame of reference (i.e has the smallest Z coordinate). More...
 
(id) - leftmost
 The member of the list that is farthest to the left within the standard Leap frame of reference (i.e has the smallest X coordinate). More...
 
(id) - rightmost
 The member of the list that is farthest to the right within the standard Leap frame of reference (i.e has the largest X coordinate). More...
 

Detailed Description

The LeapPointableOrHandList category provides methods for getting objects from an NSArray containing LeapPointable, LeapFinger, or LeapHand objects based on their physical position within the Leap coordinate system.

LeapFinger *farLeft = frame.fingers.leftmost;
LeapFinger *mostForwardOnHand = ((LeapHand*)[frame.hands objectAtIndex:0]).fingers.frontmost;
LeapTool *rightTool = frame.tools.rightmost;
Since 1.0

Method Documentation

- (NSArray *) extended

Returns a new list containing those members of the current list that are extended.

This includes all tools and any fingers whose [LeapPointable isExtended] function is true. Unlike its C++ counterpart, this method does not modify the original NSArray.

NSArray *fingerList = frame.fingers;
NSArray *extendedFingers = [fingerList extended];
Returns
The list of tools and extended fingers from the current list.
Since 2.0
- (NSArray *) fingerType: (LeapFingerType)  type

Returns a new list containing those Pointable objects in the current list that are of the specified finger type.

NSArray *allFingers = frame.fingers;
NSArray *indexFingers = [allFingers fingerType:LEAP_FINGER_TYPE_INDEX];
Returns
The list of matching fingers from the current list.
Since 2.0
- (id) frontmost

The member of the list that is farthest to the front within the standard Leap frame of reference (i.e has the smallest Z coordinate).

LeapHand *frontmostHand = handList.frontmost;
LeapFinger *frontmostFinger = frontmostHand.fingers.frontmost;

Returns nil if the NSArray is empty.

Since 1.0
- (id) leftmost

The member of the list that is farthest to the left within the standard Leap frame of reference (i.e has the smallest X coordinate).

LeapHand *leftmostHand = handList.leftmost;
LeapFinger *leftmostFinger = leftmostHand.fingers.leftmost;

Returns nil if the NSArray is empty.

Since 1.0
- (id) rightmost

The member of the list that is farthest to the right within the standard Leap frame of reference (i.e has the largest X coordinate).

LeapHand *rightmostHand = handList.rightmost;
LeapFinger *rightmostFinger = rightmostHand.fingers.rightmost;

Returns nil if the NSArray is empty.

Since 1.0