User Tools

Site Tools


gestures:touch:advanced:gesture-filtering:n-pivot-inertia

N-Pivot-Inertia

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

This gesture can only be activated by a single touch point. The n-rotate-inertia gesture analyzes the motion of the touch point cluster and returns the change in the rotation “pivot_dtheta”. Two filters are added to the 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 decay. These values are then pushed into the delta filter. In the delta filter, when a return value is equal to or below the delta min value (0.01) the return value is set to zero.

The value in the dimension is then mapped to the object rotation in the gesture event update. This has the cumulative effect of “easing” the rotation of the touch object once the matching criteria is broken (touch point number does not equal one).

<Gesture id="1-finger-pivot-inertia" type="pivot">
    <match>
        <action>
            <initial>
                <cluster point_number="1" point_number_min="1" point_number_max="1"/>
            </initial>
        </action>
    </match>
    <analysis>
        <algorithm class="kinemetric" type="continuous">
            <library module="pivot"/>
            <returns>
                <property id="pivot_dtheta" result="pivot_dtheta"/>
            </returns>
        </algorithm>
    </analysis>    
    <processing>
        <inertial_filter>
            <property ref="pivot_dtheta" active="true" friction="0.9"/>
        </inertial_filter>
        <delta_filter>
            <property ref="pivot_dtheta" active="true" delta_min="0.01" delta_max="10"/>
        </delta_filter>
    </processing>
    <mapping>
        <update dispatch_type="continuous">
            <gesture_event type="pivot">
                <property ref="pivot_dtheta" target="rotate"/>
            </gesture_event>
        </update>
    </mapping>
</Gesture>
gestures/touch/advanced/gesture-filtering/n-pivot-inertia.txt · Last modified: 2015/09/14 19:37 by glass