User Tools

Site Tools



(Touch → Advanced → Gesture Filtering → N Point Drag Gesture With Inertial Filter “N-Drag-Inertia”)

This gesture allows for any “n” number of touch points between 1 and 10. The n-drag-inertia gesture analyzes the motion of the touch point cluster and returns the translation in the x and y direction “dx” and “dy”. Two filters are added to each gesture dimension, a inertial filter and a delta filter.

The inertial filter has the effect of caching the results and then returning values that exponentially decays. This value is then pushed into the delta filter. In the delta filter, when the return value is equal to or below the delta min value (0.5) the return value is set to zero.

The values in each dimension are then mapped to x and y in the gesture event update. This has the cumulative effect of “easing” the motion of the touch object once matching criteria is broken (number of touch points equals zero or more than 10).

<Gesture id="n-drag-inertia" type="drag">
                <cluster point_number="0" point_number_min="1" point_number_max="10"/>
        <algorithm class="kinemetric" type="continuous">
            <library module="drag"/>
                    <property id="drag_dx" result="dx"/>
                    <property id="drag_dy" result="dy"/>
            <property ref="drag_dx" active="true" friction="0.9"/>
            <property ref="drag_dy" active="true" friction="0.9"/>
            <property ref="drag_dx" active="true" delta_min="0.5" delta_max="500"/>
            <property ref="drag_dy" active="true" delta_min="0.5" delta_max="500"/>
        <update dispatch_type="continuous">
            <gesture_event type="drag">
                <property ref="drag_dx" target="x"/>
                <property ref="drag_dy" target="y"/>
gestures/touch/advanced/gesture-filtering/n-drag-inertia.txt · Last modified: 2019/01/29 19:07 (external edit)