Add optional non-simultaneous transform restriction#262
Add optional non-simultaneous transform restriction#262kevin-d-omara wants to merge 2 commits intoTouchScript:developTouchScript/TouchScript:developfrom kevin-d-omara:dev-nonsimultaneous-transformkevin-d-omara/TouchScript:dev-nonsimultaneous-transformCopy head branch name to clipboard
Conversation
Can now disallow multiple types of transformations to occur each time a gesture is used. For example, when a gesture is used to rotate it cannot scale or translate. Once the gesture ends it is reset and can again be used for any type of transformation. There is a checkbox in the inspector to select this option. It is under Advanced > General > Simultaneous Transforms. It works for both One- and Two- Point transformations, including two-finger translation, 2+ finger transformations, and clustered transforms.
|
Hm... can't you just have the same effect with two gestures, each set up to translation/rotation only? |
|
Great idea! I just tried it out (three gestures: one each for translation, rotation, and scaling). It does restrict transformations to a single type per use (like my proposed changes). Unfortunately, it behaves erratically. For example, a "zoom out" sometimes rotates instead. This is because the fingers don't travel in a perfectly straight line outwards. They tend to make a shallow "V", which triggers rotation. Also, translation is sometimes scale or rotate instead. Note: I required translation to have a minimum of two pointers because the game I'm working on needs camera panning to be done with two fingers, not one. |
Previously, if a transform type was not allowed (i.e. rotation), but the finger movement for that type was made, the gesture would still get locked into that type.
|
Hm... I'll experiment with this. I don't see why 3 gestures (set up with the same constraints) is different then your approach. |
|
Thanks for looking into it. Note: you must experiment on an actual touch device. The simulated pointers move perfectly parallel/perpendicular and so the issue won't arise. Let me try to explain the difference: 3 Gestures
There's the problem (in bold). Fingers rarely travel in perfectly parallel/perpendicular lines. So, a Proposed Changes
Instead of relying on the order gestures are checked, we explicitly determine the desired transform type (see original post). This way, small magnitude changes are filtered out. |
Why?
I added this option because controlling a camera's translation, rotation, and scaling at the same time was too fiddly. For example, rotating would also zoom the camera. This way, a person can rotate without worrying about zooming, zoom without translating, etc.
What?
Can now disallow multiple types of transformations to occur each time a
gesture is used.
For example, when a gesture is used to rotate it cannot scale or
translate. Once the gesture ends it is reset and can again be used for
any type of transformation.
There is a checkbox in the inspector to select this option. It is under
Advanced > General > Simultaneous Transforms.
It works for both One- and Two- Point transformations, including
two-finger translation, 2+ finger transformations, and clustered
transforms.
How?
Here's a picture explaining how I determine which gesture to lock into: