The SwipeGesture class represents a swiping motion a finger or tool.
More...
Inherits Gesture.
The SwipeGesture class represents a swiping motion a finger or tool.
controller.enableGesture(
Gesture.Type.TYPE_SWIPE);
- Deprecated:
- 3.0
Constructs a SwipeGesture object from an instance of the Gesture class.
if(gesture.type() ==
Gesture.Type.TYPE_SWIPE) {
SwipeGesture swipeGesture = new SwipeGesture(gesture);
}
- Parameters
-
- Deprecated:
- 3.0
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
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
The finger performing the swipe gesture.
Pointable swiper = swipe.pointable();
- Returns
- Pointable A Pointable object representing the swiping finger.
- Deprecated:
- 3.0
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
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
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