Documentation
The SwipeGesture class represents a swiping motion of a finger or tool. More...
Inherits com.leapmotion.leap.Gesture.
Public Member Functions | |
| Vector | direction () |
| The unit direction vector parallel to the swipe motion. |
|
| Pointable | pointable () |
| The finger performing the swipe gesture. |
|
| Vector | position () |
| The current position of the swipe. |
|
| float | speed () |
| The swipe speed in mm/second. |
|
| Vector | startPosition () |
| The position where the swipe began. |
|
| SwipeGesture (Gesture rhs) | |
| Constructs a SwipeGesture object from an instance of the Gesture class. |
|
Public Member Functions inherited from com.leapmotion.leap.Gesture
| |
| long | duration () |
| The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds. |
|
| float | durationSeconds () |
| The elapsed duration in seconds. |
|
| boolean | equals (Gesture rhs) |
| Compare Gesture object equality. |
|
| Frame | frame () |
| The Frame containing this Gesture instance. |
|
| Gesture () | |
| Constructs a new Gesture object. |
|
| Gesture (Gesture rhs) | |
| Constructs a new copy of an Gesture object. |
|
| HandList | hands () |
| The list of hands associated with this Gesture, if any. |
|
| int | id () |
| The gesture ID. |
|
| boolean | isValid () |
| Reports whether this Gesture instance represents a valid Gesture. |
|
| PointableList | pointables () |
| The list of fingers and tools associated with this Gesture, if any. |
|
| Gesture.State | state () |
| The gesture state. |
|
| String | toString () |
| A string containing a brief, human-readable description of this Gesture. |
|
| Gesture.Type | type () |
| The gesture type. |
|
Static Public Member Functions | |
| static Gesture.Type | classType () |
| The swipe gesture type. |
|
Static Public Member Functions inherited from com.leapmotion.leap.Gesture
| |
| static Gesture | invalid () |
| Returns an invalid Gesture object. |
|
Detailed Description
The SwipeGesture class represents a swiping motion of a finger or tool.
Important: To use swipe gestures in your application, you must enable recognition of the swipe gesture. You can enable recognition with:
Swipe gestures are continuous.
You can set the minimum length and velocity required for a movement to be recognized as a swipe using the config attribute of a connected Controller object. Use the following keys to configure swipe recognition:
| Key string | Value type | Default value | Units |
|---|---|---|---|
| Gesture.Swipe.MinLength | float | 150 | mm |
| Gesture.Swipe.MinVelocity | float | 1000 | mm/s |
The following example demonstrates how to set the swipe configuration parameters:
- Since
- 1.0
Constructor & Destructor Documentation
| com.leapmotion.leap.SwipeGesture.SwipeGesture | ( | Gesture | rhs | ) |
Constructs a SwipeGesture object from an instance of the Gesture class.
- Parameters
-
rhs The Gesture instance to specialize. This Gesture instance must be a SwipeGesture object.
- Since
- 1.0
Member Function Documentation
|
static |
The swipe gesture type.
- Returns
- Type The type value designating a swipe gesture.
- Since
- 1.0
| Vector com.leapmotion.leap.SwipeGesture.direction | ( | ) |
The unit direction vector parallel to the swipe motion.
You can compare the components of the vector to classify the swipe as appropriate for your application. For example, if you are using swipes for two dimensional scrolling, you can compare the x and y values to determine if the swipe is primarily horizontal or vertical.
- Returns
- Vector The unit direction vector representing the swipe motion.
- Since
- 1.0
| Pointable com.leapmotion.leap.SwipeGesture.pointable | ( | ) |
| Vector com.leapmotion.leap.SwipeGesture.position | ( | ) |
The current position of the swipe.
- Returns
- Vector The current swipe position within the Leap Motion frame of reference, in mm.
- Since
- 1.0
| float com.leapmotion.leap.SwipeGesture.speed | ( | ) |
The swipe speed in mm/second.
- Returns
- float The speed of the finger performing the swipe gesture in millimeters per second.
- Since
- 1.0
Public Member Functions inherited from