SwipeGestureΒΆ

The SwipeGesture class represents a swiping motion a finger or tool. More...

Inherits Gesture.

Public Member Functions

Vector direction ()
 The unit direction vector parallel to the swipe motion. More...
 
Pointable pointable ()
 The finger performing the swipe gesture. More...
 
Vector position ()
 The current position of the swipe. More...
 
float speed ()
 The swipe speed in mm/second. More...
 
Vector startPosition ()
 The position where the swipe began. More...
 
 SwipeGesture (Gesture rhs)
 Constructs a SwipeGesture object from an instance of the Gesture class. More...
 
- Public Member Functions inherited from Gesture
long duration ()
 The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds. More...
 
float durationSeconds ()
 The elapsed duration in seconds. More...
 
boolean equals (Gesture rhs)
 Compare Gesture object equality. More...
 
Frame frame ()
 The Frame containing this Gesture instance. More...
 
 Gesture ()
 Constructs a new Gesture object. More...
 
 Gesture (Gesture rhs)
 Constructs a new copy of an Gesture object. More...
 
HandList hands ()
 The list of hands associated with this Gesture, if any. More...
 
int id ()
 The gesture ID. More...
 
boolean isValid ()
 Reports whether this Gesture instance represents a valid Gesture. More...
 
PointableList pointables ()
 The list of fingers and tools associated with this Gesture, if any. More...
 
Gesture.State state ()
 The gesture state. More...
 
String toString ()
 A string containing a brief, human-readable description of this Gesture. More...
 
Gesture.Type type ()
 The gesture type. More...
 

Static Public Member Functions

static Gesture.Type classType ()
 The swipe gesture type. More...
 
- Static Public Member Functions inherited from Gesture
static Gesture invalid ()
 Returns an invalid Gesture object. More...
 

Detailed Description

The SwipeGesture class represents a swiping motion a finger or tool.

controller.enableGesture(Gesture.Type.TYPE_SWIPE);
Deprecated:
3.0

Constructor & Destructor Documentation

Constructs a SwipeGesture object from an instance of the Gesture class.

if(gesture.type() == Gesture.Type.TYPE_SWIPE) {
SwipeGesture swipeGesture = new SwipeGesture(gesture);
}
Parameters
rhsThe Gesture instance to specialize. This Gesture instance must be a SwipeGesture object.
Deprecated:
3.0

Member Function Documentation

static Gesture.Type classType ( )
static

The swipe gesture type.

if(gesture.type() == SwipeGesture.classType()) {
SwipeGesture swipeGesture = new SwipeGesture(gesture);
}
Returns
Type The type value designating a swipe gesture.
Deprecated:
3.0
Vector direction ( )

The unit direction vector parallel to the swipe motion.

Vector swipeDirection = swipe.direction();

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.
Deprecated:
3.0
Pointable pointable ( )

The finger performing the swipe gesture.

Pointable swiper = swipe.pointable();
Returns
Pointable A Pointable object representing the swiping finger.
Deprecated:
3.0
Vector position ( )

The current position of the swipe.

Vector currentSwipePosition = swipe.position();
Returns
Vector The current swipe position within the Leap Motion frame of reference, in mm.
Deprecated:
3.0
float speed ( )

The swipe speed in mm/second.

float currentSwipeSpeed = swipe.speed();
Returns
float The speed of the finger performing the swipe gesture in millimeters per second.
Deprecated:
3.0
Vector startPosition ( )

The position where the swipe began.

Vector swipeStart = swipe.startPosition();
Returns
Vector The starting position within the Leap Motion frame of reference, in mm.
Deprecated:
3.0