Notice Gestures are deprecated in version 3.0 and may not behave the same as they did in earlier versions.
Properties:
Methods:
The LeapSwipeGesture class represents a swiping motion of fingers and tools.
[controller.config setFloat:@"Gesture.Swipe.MinLength" value:200.0]; [controller.config setFloat:@"Gesture.Swipe.MinVelocity" value:750]; [controller.config save];Public FunctionsProperty- (BOOL) equals:(const LeapGesture *) otherCompare LeapGesture object equality.
[thisGesture equals:thatGesture];
- Parameters
- other -
The LeapGesture object to compare.
- (LeapPointable *) pointableThe finger or tool performing the swipe gesture.
LeapPointable *gesturer = swipe.pointable;
- Return
- A LeapPointable object representing the swiping finger or tool.
Public Static Functionsdirection- (LeapVector *) directionThe unit direction vector parallel to the swipe motion.
LeapVector *direction = swipe.direction;
- Return
- LeapVector The unit direction vector representing the swipe motion.
duration- (int64_t) durationThe elapsed duration of the recognized movement up to the frame containing this LeapGesture object, in microseconds.
int64_t microseconds = gesture.duration;
- Return
- int64_t the elapsed duration in microseconds.
durationSeconds- (float) durationSecondsThe elapsed duration in seconds.
float seconds = gesture.duration;
- See
- duration
- Return
- float the elapsed duration in seconds.
frame- (LeapFrame *) frameThe LeapFrame containing this LeapGesture instance.
LeapFrame *owningFrame = gesture.frame;
- Return
- The parent LeapFrame object.
hands- (NSArray *) handsThe list of hands associated with this LeapGesture, if any.
NSArray *handList = gesture.hands; //Only one hand for current gestures LeapHand *gesturingHand = [handList objectAtIndex:0];
- Return
- NSArray the list of related LeapHand objects.
id- (int32_t) idisValid- (BOOL) isValidReports whether this LeapGesture instance represents a valid gesture.
LeapFrame *frame = [controller frame:0]; LeapGesture *trackedGesture = [frame gesture:trackedGestureID]; if(trackedGesture.isValid) { //Use the data... }
- Return
- bool Yes, if this is a valid LeapGesture instance; NO, otherwise.
pointables- (NSArray *) pointablesThe list of fingers and tools associated with this LeapGesture, if any.
NSArray *pointableList = gesture.pointables; //Only one pointable for current gestures LeapHand *gesturingPointable = [pointableList objectAtIndex:0];
- Return
- NSArray the list of related LeapPointable objects.
position- (LeapVector *) positionThe current position of the swipe.
LeapVector *current = swipe.position;
- Return
- LeapVector The current swipe position within the Leap frame of reference, in mm.
speed- (float) speedThe swipe speed in mm/second.
float velocity = swipe.speed;
- Return
- float The speed of the finger performing the swipe gesture in millimeters per second.
startPosition- (LeapVector *) startPositionThe position where the swipe began.
LeapVector *start = swipe.startPosition;
- Return
- LeapVector The starting position within the Leap frame of reference, in mm.
state- (LeapGestureState) stateThe gesture state.
- Return
- LeapGestureState A value from the LeapGestureState enumeration.
type- (LeapGestureType) typeThe gesture type.
LeapGestureType type = gesture.type;
- Return
- LeapGestureType A value from the LeapGestureType enumeration.
+ (LeapGesture *) invalidReturns an invalid LeapGesture object.
LeapGesture *wrongGesture = LeapGesture.invalid;
- Return
- The invalid LeapGesture instance.