Class: CircleGesture

CircleGesture

The CircleGesture 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 when you create the Leap Controller or start the Leap.loop().

TODO

Circle gestures are continuous. The CircleGesture objects for the gesture have three possible states:

  • start -- The circle gesture has just started. The movement has progressed far enough for the recognizer to classify it as a circle.
  • update -- The circle gesture is continuing.
  • stop -- The circle gesture is finished.

new CircleGesture()

Constructs a new CircleGesture object.

An uninitialized CircleGesture object is considered invalid. Get valid instances of the CircleGesture class from a Frame object.

Source:
  • gesture.js, line 149

Members

center :Vector

The center point of the circle within the Leap frame of reference.

Type:
  • Vector
Source:
  • gesture.js, line 179

normal :Vector

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.

var clockwiseness; if (circle.pointable.direction.angleTo(circle.normal) <= PI/4) { clockwiseness = "clockwise"; } else { clockwiseness = "counterclockwise"; }

Type:
  • Vector
Source:
  • gesture.js, line 186

progress :Number

The number of times the finger tip has traversed the circle.

Progress is reported as a positive number of the number. For example, a progress value of .5 indicates that the finger has gone halfway around, while a value of 3 indicates that the finger has gone around the the circle three times.

Progress starts where the circle gesture began. Since the circle must be partially formed before the Leap can recognize it, progress will be greater than zero when a circle gesture first appears in the frame.

Type:
  • Number
Source:
  • gesture.js, line 209

radius :Number

The radius of the circle in mm.

Type:
  • Number
Source:
  • gesture.js, line 226