-
Notifications
You must be signed in to change notification settings - Fork 533
Feat/ios modern vibration api #2247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/ios modern vibration api #2247
Conversation
Can it be tested on a physical device too? |
|
Thanks for the comment, yes ideally it should be async so it's not blocking the rest of the game's processes. I haven't measured it but most likely there'd be a noticeable performance cost using synchronous implementation that's currently in place. And I'll test it in my mobile device. With this native API, there's fields that can be adjusted to change how intense and "sharp" the vibration feels. I'll keep them in them as is since further customization would necessitate us to update Love2D's vibrate API for macOS, which would not be so clean potentially if we want to keep this in parity with the Android version. |
2681c9f to
fbb0c7f
Compare
…h thorough logging and error handling.
66f010c to
53f56fc
Compare
|
Made the changes and created a minimal Love2D project, which cycles through 3 different vibration calls on iOS. 1st tap tap goes for 1 second, 2nd tap goes for 3 seconds, and the 3rd tap goes for 5 seconds. 4th tap rotates back to the 1 second vibration. Love2D-vibration-change-on-iOS.MOVBuilt successfully with no errors or warnings related to the Haptic Engine initialization (error message did help me identify a missing field though so thanks for suggesting that). Btw device is an |
Fixes #1904
Changes
secondsduration field from vibrate calls tovoid vibrate()method in/src/common/ios.mmthat was previously being ignored.vibrate()iOS method using iOS 13+ CHHapticEngine.Tested