Lofelt / NiceVibrations

🎮 🚀 Nice Vibrations and Lofelt Studio SDK source code repository
MIT License
125 stars 17 forks source link

Multiple Haptics at the same time #42

Closed euleromer closed 5 months ago

euleromer commented 5 months ago

Hello there, I am a solo developer and using nice-vibrations for the haptics of my application.

Since the way nice vibrations works is a black box to me I have the following question:

How does Nice Vibrations handle 2 vibrations that take place in the same frame? Does it add up the intensities and sharpness of both or does it just take the dominant parameters in terms of sharpness and intensity and play only 1 haptic?

Help would be great!

neil-meta commented 5 months ago

It only plays 1 clip at a time (as mixing is not a good idea on such small motors, the signals become indistinct and 'muddy') and chooses which clip to play using the priortiy feature.

See all about how priority works here: https://github.com/Lofelt/NiceVibrations/wiki/1.-Nice-Vibrations-developer-documentation#haptic-source

Haptic mixing is a super complex topic but basically is not a good idea for 99% of cases. Layer your haptics using prioritisation: that way your most important haptics will interrupt your least important. We wrote a set of guidelines for Quest on this, but to be honest they are general design guidelines for haptics and apply to iOS too for the most part: https://developer.oculus.com/resources/haptics-design-guidelines/