Cycling74 / miraweb

MIT License
138 stars 14 forks source link

Fix mira.multitouch to report rotation value correctly #146

Open fde31 opened 5 years ago

fde31 commented 5 years ago

This is a fix for #116 Basically there were some typos and missing conversion to radians in order to allow mira.multitouch to report the touch rotation value correctly. This should mostly work but I think it needs some offset adjustment in order to map the rotation value correctly, as done by Mira App. I don't have access to a Mira App install right now so I might need your help @starakaj to figure out how the rotation is supposed to be reported so we apply the correct offset here before we merge this PR into dev.

fde31 commented 5 years ago

Adding a test patcher

----------begin_max5_patcher----------
930.3oc0XE0bhBCD9Y8WACO64PHP.t2teGc53DwnMsPhSHX8ta5+8aIADvhh
0Ru4NmwfrYI6te62tI3umOycs7Hqv046NO3La1umOalQTkfY02OyMmdLMiVX
TycCml4tvNwApRPyYuSNeiQjb8yeKB0HbOUA5pYpULAccl4oP0yIJy4hLltn
qvMrcJl04vDuZgayjTsrTuuTe1B.BOeEJ3+xXF+kdmbBc5SbwtUJVp1F1DLL
qS.NbYHbwybCL57X8iXWW8O2yr5acA2SyWPOv1rhp0J95RMq8WE0nXMLVAWY
kL41FwMx6BMYRwtgfzdJwEG3E79PXOExgLVu3t2rEOIU5QMRS.isS8174sWL
iuMewMRY..CxOCQZry7.9wgXNd2MyYqTnax8n1jeeRheGkO4P+P0gFO.YAgh
rzjfJdRngs36eM1h6BG20TwtVByVoJmZVOxWNE5b.9iwi5yTt5Z82jt3ODcg
D+OHcot2x+YrE+Ijs3+UyVDrWgzeSNPyNZvJ2BVlimCZHhB1cHx.9iPFv2Uu
iH+N8NBHiyFLLgEsWAVwcfPYrMCACAWqdoIr46DRHBx3ouLZYjb61TYlTYcd
frGg8QQKfeQpF77PdAvsnNQ7vaaOD1kDavNbjA07ZFuL1wEc1id8tddV3hNC
c8GoneDfChHAU5kfhQjXSXT+DSWhfL0IhaGUqYjeTTc5JSy4J5xb8RkTS0rA
PmvX2Ocq6f6u0Ml.PSRRRTXXbXBNBPq3vaqM9ou2EdYAlxLMGNsa5SmbTEqf
I.rhKEcSjlTG1CsD4AeHHObHJj3CtqeLZIFhfDbbBIHNvDCnjjkwUZh8BQQg
QwH+SASGv2+pXultekw4VkJKE5tr0hW46Y0r3M8HgbAn+PSzIvFmKenfsKGT
uWyXqQufGcwLbh2DfYum.bZpdMThLMc5N1tFUv4..ySCEpFnG99tvzVG0act
Wx21plQCTQ1tm5MzRZ3BxqjT7iqRJjHawGzz2OJHFEk.ueVDFxLjt0cqoour
SAXv6hTiJtYbw4ubqwjUx6G9ExRUZSxql56zZnMrBMWbhb9PauImKsUvsZHy
h3OhkpNyxzXowhIxjESnQrT0628osjAXFyRUG0YZrznnGYJrzsjmp9eUNyRV
NOc+9CLUQs1Fi.E2Oa6AEuvbKWXu0TG5pXUGr2pu4sbboJnrTC0jkJ6lkGqO
snatbCSIJ400aP3Alzz3nZi0h8TajX5uL+s4+APKwwUy
-----------end_max5_patcher-----------
fde31 commented 5 years ago

HammerJS doesn't seem to get any updates from what I can tell. I have made a fork and started working on adding a rotationDelta property to the rotation gesture to mimic the iOS behaviour (see commits here https://github.com/fde31/hammer.js/commits/fde/adjust_rotation_gesture). This would also mean to implement the velocity correctly according to the iOS standard, which mira.frame is based on in radians/sec. However, this is unfortunately a bit of a head scratcher. It's doable but not 100% sure we wanna squeeze this in now or re-evaluate for 1.3.0

Any thoughts @starakaj @benbrackenc74 ?

fde31 commented 5 years ago

after quick consultation with @starakaj pushing this to 1.3.0. Might wanna investigate the 2018 landscape for gesture handling etc before attempting to adjust / fix hammer etc.