User Tools

Site Tools



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

This gesture allows for any “n” number of touch points between 2 and 10. The n-scale-inertia gesture analyzes the motion of the touch point cluster and returns the change in the separation in x and y direction “dsx” and “dsy”. 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. 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 values in each dimension are then mapped to scaleX and scaleY in the gesture event update. This has the cumulative effect of “easing” the scaling of the touch object once the matching criteria is broken (touch point number equals zero, one or more than ten).

<Gesture id="n-rotate-inertia" type="rotate">
              <cluster point_number="0" point_number_min="2" point_number_max="10"/>
      <algorithm class="kinemetric" type="continuous">
          <library module="rotate"/>
              <property id="rotate_dtheta" result="dtheta"/>
          <property ref="rotate_dtheta" active="true" friction="0.9"/>
          <property ref="rotate_dtheta" active="true" delta_min="0.01" delta_max="2"/>
      <update dispatch_type="continuous">
          <gesture_event type="rotate">
              <property ref="rotate_dtheta" target="rotate"/>
gestures/touch/advanced/gesture-filtering/n-scale-inertia.txt · Last modified: 2019/01/29 19:07 (external edit)