LeapCircleGesture Class Reference
Inherits from | LeapGesture : NSObject |
Declared in | LeapObjectiveC.h |
Overview
The LeapCircleGesture classes represents a circular finger movement.
A circle movement is recognized when the tip of a finger draws a circle
within the Leap field of view.
Important: To use circle gestures in your application, you must enable
recognition of the circle gesture. You can enable recognition with:
[controller enableGesture:LEAP_GESTURE_TYPE_CIRCLE enable:YES];
Circle gestures are continuous. The LeapCircleGesture objects for the gesture have
three possible states:
- LEAP_GESTURE_STATE_START – The circle gesture has just started. The movement has
progressed far enough for the recognizer to classify it as a circle. - LEAP_GESTURE_STATE_UPDATE – The circle gesture is continuing.
- LEAP_GESTURE_STATE_STOP – The circle gesture is finished.
You can set the minimum radius and minimum arc length required for a movement
to be recognized as a circle using the config attribute of a connected
LeapController object. Use the following keys to configure circle recognition:
Key string | Value type | Default value | Units |
---|---|---|---|
Gesture.Circle.MinRadius | float | 5.0 | mm |
Gesture.Circle.MinArc | float | 1.5*pi | radians |
The following example demonstrates how to set the circle configuration
parameters:
if([controller.config setFloat:@"Gesture.Circle.MinRadius" value:10.0] &&
[controller.config setFloat:@"Gesture.Circle.MinArc" value:.5])
[controller.config save];
Tasks
-
– center
The center point of the circle within the Leap frame of reference.
-
– normal
Returns the normal vector for the circle being traced.
-
– radius
The radius of the circle.
-
– pointable
The finger performing the circle gesture.
Instance Methods
center
The center point of the circle within the Leap frame of reference.
- (LeapVector *)center
Return Value
LeapVector The center of the circle in mm from the Leap origin.
Discussion
The center point of the circle within the Leap frame of reference.
Declared In
LeapObjectiveC.h
normal
Returns the normal vector for the circle being traced.
- (LeapVector *)normal
Return Value
LeapVector the normal vector for the circle being traced
Discussion
Returns the normal vector for the circle being traced.
If you draw the circle clockwise, the normal vector points in the same
general direction as the pointable object drawing the circle. If you draw
the circle counterclockwise, the normal points back toward the
pointable. If the angle between the normal and the pointable object
drawing the circle is less than 90 degrees, then the circle is clockwise.
NSString* clockwiseness;
if ([[[circleGesture pointable] direction] angleTo:[circleGesture normal]] <= LEAP_PI/4) {
clockwiseness = @"clockwise";
}
else {
clockwiseness = @"counterclockwise";
}
Declared In
LeapObjectiveC.h
pointable
The finger performing the circle gesture.
- (LeapPointable *)pointable
Return Value
A LeapPointable object representing the circling finger.
Discussion
The finger performing the circle gesture.
Declared In
LeapObjectiveC.h