Properties:
Methods:
The SwipeGesture class represents a swiping motion a finger or tool.
controller.EnableGesture (Gesture.GestureType.TYPE_SWIPE);Public FunctionsPropertySwipeGesture(Gesture rhs)Constructs a SwipeGesture object from an instance of the Gesture class.
if (gesture.Type == Gesture.GestureType.TYPE_SWIPE) { SwipeGesture swipeGesture = new SwipeGesture (gesture); }
- Parameters
- rhs -
The Gesture instance to specialize. This Gesture instance must be a SwipeGesture object.
Public Static FunctionsVector 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.
- Return
- Vector The unit direction vector representing the swipe motion.
Pointable Pointable
Vector Position
The current position of the swipe.
Vector currentSwipePosition = swipe.Position;
- Return
- Vector The current swipe position within the Leap Motion frame of reference, in mm.
float Speed
The swipe speed in mm/second.
float currentSwipeSpeed = swipe.Speed;
- Return
- float The speed of the finger performing the swipe gesture in millimeters per second.
Vector StartPosition
The position where the swipe began.
Vector swipeStart = swipe.StartPosition;
- Return
- Vector The starting position within the Leap Motion frame of reference, in mm.
Gesture.GestureType ClassType()The swipe gesture type.
if (gesture.Type == SwipeGesture.ClassType ()) { SwipeGesture swipeGesture = new SwipeGesture (gesture); }
- Return
- Type The type value designating a swipe gesture.