User Tools

Site Tools


using_the_multiply_filter_to_create_fast-drag_gesture

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

using_the_multiply_filter_to_create_fast-drag_gesture [2015/10/09 18:18]
paul
using_the_multiply_filter_to_create_fast-drag_gesture [2019/01/29 19:07]
Line 1: Line 1:
-====== Using The "​Multiply Filter"​ To Create Fast-Drag Gesture ====== 
  
-===== The Multiply Filter ===== 
- 
-The multiply filter is a simple filter that is inserted into the processing block of a gesture object and enables the result each gesture dimension to be multiplied. In this example each dimension is multiplied by a factor of two. This has the effect of doubling the return value. ​ 
- 
-<​code:​csharp linenums:​1>​ 
-<Gesture id="​2-point-power-drag"​ type="​drag">​ 
-    <​match>​ 
-        <​action>​ 
-            <​initial>​ 
-                <cluster point_number="​2"/>​ 
-            </​initial>​ 
-        </​action>​ 
-    </​match> ​       
-    <​analysis>​ 
-         <​algorithm class="​kinemetric"​ type="​continuous">​ 
-            <library module="​drag"/>​ 
-            <​returns>​ 
-                <​property id="​dx"​ result="​dx"/>​ 
-                <​property id="​dy"​ result="​dy"/>​ 
-            </​returns>​ 
-        </​algorithm>​ 
-    </​analysis>​ 
-    <​processing>​ 
-        <​multiply_filter>​ 
-            <​property ref="​dx"​ active="​true"​ factor="​2"/>​ 
-            <​property ref="​dy"​ active="​true"​ factor="​2"/>​ 
-        </​multiply_filter>​ 
-    </​processing>​ 
-    <​mapping>​ 
-        <update dispatch_type="​continuous">​ 
-            <​gesture_event type="​drag">​ 
-                <​property ref="​dx"​ target="​x"/>​ 
-                <​property ref="​dy"​ target="​y"/>​ 
-            </​gesture_event>​ 
-        </​update>​ 
-    </​mapping>​ 
-</​Gesture>​ 
-</​code>​ 
- 
-The "​2-point-power-drag"​ moves touch objects twice as fast as the calculated velocity of the touch point cluster. This is a great gesture for power sliding across a long list of menu items. 
-The multiply filter can be dynamically activated on each dimension by setting active="​true"​. This can be done independently. For example this gesture will drag objects normally in the x direction but twice as fast in the y direction: 
- 
-<​code:​csharp linenums:​1>​ 
-<Gesture id="​2-point-power-drag-y-only"​ type="​drag">​ 
-    <​match>​ 
-        <​action>​ 
-            <​initial>​ 
-                <cluster point_number="​2"/>​ 
-            </​initial>​ 
-        </​action>​ 
-    </​match> ​       
-    <​analysis>​ 
-        <​algorithm class="​kinemetric"​ type="​continuous">​ 
-            <library module="​drag"/>​ 
-            <​returns>​ 
-                <​property id="​dx"​ result="​dx"/>​ 
-                <​property id="​dy"​ result="​dy"/>​ 
-            </​returns>​ 
-        </​algorithm>​ 
-    </​analysis>​ 
-    <​processing>​ 
-        <​multiply_filter>​ 
-            <​property ref="​dx"​ active="​false"/>​ 
-            <​property ref="​dy"​ active="​true"​ factor="​2"/>​ 
-        </​multiply_filter>​ 
-    </​processing>​ 
-     <​mapping>​ 
-        <update dispatch_type="​continuous">​ 
-            <​gesture_event type="​drag">​ 
-                <​property ref="​dx"​ target="​x"/>​ 
-                <​property ref="​dy"​ target="​y"/>​ 
-            </​gesture_event>​ 
-        </​update>​ 
-    </​mapping>​ 
-</​Gesture>​ 
-</​code>​ 
- 
-The multiplication factor can be any negative or positive value. Setting factor to "​-1"​ will effectively reflect the value of the gesture dimension. For example in this example the motion of the drag gesture will be in the opposite direction to the gesture action: 
- 
-<​code:​csharp linenums:​1>​ 
-<Gesture id="​2-point-drag-reflected"​ type="​drag">​ 
-    <​match>​ 
-        <​action>​ 
-            <​initial>​ 
-                <cluster point_number="​2"/>​ 
-            </​initial>​ 
-        </​action>​ 
-    </​match> ​       
-    <​analysis>​ 
-        <​algorithm class="​kinemetric"​ type="​continuous">​ 
-            <library module="​drag"/>​ 
-            <​returns>​ 
-                <​property id="​dx"​ result="​dx"/>​ 
-                <​property id="​dy"​ result="​dy"/>​ 
-             </​returns>​ 
-        </​algorithm>​ 
-    </​analysis>​ 
-    <​processing>​ 
-        <​multiply_filter>​ 
-            <​property ref="​dx"​ active="​true"​ factor="​-1"/>​ 
-            <​property ref="​dy"​ active="​true"​ factor="​-1"/>​ 
-        </​multiply_filter>​ 
-    </​processing>​ 
-    <​mapping>​ 
-        <update dispatch_type="​continuous">​ 
-            <​gesture_event type="​drag">​ 
-                <​property ref="​dx"​ target="​x"/>​ 
-                <​property ref="​dy"​ target="​y"/>​ 
-            </​gesture_event>​ 
-        </​update>​ 
-    </​mapping>​ 
-</​Gesture>​ 
-</​code>​ 
- 
- 
-The multiply filter can also multiply the result of a gesture dimension by a non-linear function of the factor. There are four different non linear methods available in the multiply filter: 
- 
-  * [[gestures:​touch:​advanced:​gesture_property_mapping:​quadratic_mapping|quadratic]] 
-  * [[gestures:​touch:​advanced:​gesture_property_mapping:​cubic_mapping|cubic]] 
-  * [[gestures:​touch:​advanced:​gesture_property_mapping:​exponential_mapping| exponential]] 
using_the_multiply_filter_to_create_fast-drag_gesture.txt · Last modified: 2019/01/29 19:07 (external edit)