LeapJS API Reference
Class

Leap.CircleGesture

Contents

class Leap.CircleGesture extends Leap.Gesture

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.

CircleGesture

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

Constructor Top

  CircleGesture ()

Properties Top

Leap.Vector center
Number duration inherited from Leap.Gesture
Array handIds inherited from Leap.Gesture
Number id inherited from Leap.Gesture
Leap.Vector normal
Array pointableIds inherited from Leap.Gesture
Number progress
Number radius
String state inherited from Leap.Gesture
String type inherited from Leap.Gesture

Constructor details Top

gesture.js at line 157
CircleGesture ()

Constructs a new CircleGesture object.

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

Properties Detail Top

gesture.js at line 183
public Leap.Vector center

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

gesture.js at line 107
public Number duration

The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds.

The duration reported for the first Gesture in the sequence (with the start state) will typically be a small positive number since the movement must progress far enough for the Leap to recognize it as an intentional gesture.

Inherited from Leap.Gesture

gesture.js at line 87
public Array handIds

The list of hands associated with this Gesture, if any.

If no hands are related to this gesture, the list is empty.

Inherited from Leap.Gesture

gesture.js at line 75
public Number id

The gesture ID.

All Gesture objects belonging to the same recognized movement share the same ID value. Use the ID value with the Frame::gesture() method to find updates related to this Gesture object in subsequent frames.

Inherited from Leap.Gesture

gesture.js at line 191
public Leap.Vector normal

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";
   }

gesture.js at line 97
public Array pointableIds

The list of fingers and tools associated with this Gesture, if any.

If no Pointable objects are related to this gesture, the list is empty.

Inherited from Leap.Gesture

gesture.js at line 216
public Number progress

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.

gesture.js at line 234
public Number radius

The radius of the circle in mm.

gesture.js at line 121
public String state

The gesture ID.

Recognized movements occur over time and have a beginning, a middle, and an end. The 'state()' attribute reports where in that sequence this Gesture object falls.

Possible values for the state field are:

Inherited from Leap.Gesture

gesture.js at line 139
public String type

The gesture type.

Possible values for the type field are:

Inherited from Leap.Gesture