elvissteinjr / DesktopPlus

Advanced desktop access for OpenVR
GNU General Public License v3.0
454 stars 29 forks source link

Feature request: Smoothed Cursor? #30

Open kinsi55 opened 2 years ago

kinsi55 commented 2 years ago

I built something like this as a Mod for Beat Saber and its such a suttle thing that makes such a big difference, and feel like having it in Desktop+ would be amazing. Hitting small Buttons reliably in VR obviously can be rather hard, I usually resort to moving my hand super close to the screen to minimize the distance and thus shake but that is ofc not ideal.

Demo (He has a condition making his hands shake rather a lot, I initially built it for him but even under "normal" conditions its a great QoL thing): https://clips.twitch.tv/HumbleGleamingShieldCclamChamp-0Szep5Op8xpGGAxq

Heres my smoothing logic and default config values I came up with - Probably not ideal but it works pretty well

elvissteinjr commented 2 years ago

Cursor smoothing/stabilization is an idea I've thought about before. Your attempt at it looks reasonably simple compared to what came up on a quick research regarding stabilization algorithms last time I had checked.

Of course it'd need some adaption as the code base here has next to none of the helpers Unity comes with (the matrix classes are somewhat barebones) and it needs to work within the constraints of SteamVR overlays (should be fine with some trickery). It's a very good reference in any case, thank you.

Can this method work well on close distance interaction (i.e. wristwatch overlay) or do you think straight up disabling there would make more sense? Ideally the parameters should scale automatically based on overlay distance in this case, imo.

Though, as helpful as this is, I'm somewhat busy with getting the new UI done. Priority-wise I may not tackle this for a while... just to not give any false promises.

kinsi55 commented 2 years ago

the code base here has next to none of the helpers Unity comes with

The helpers I use are very simple. Lerp'ing two Vectors without a helper is simple enough, same goes for calculating the angle difference of two rotations.

I think my logic works pretty well universally - The general idea is that it applies less smoothing the bigger the distance it is that you are trying to take. It definitely does feel a bit weird at first compared to "direct" input but you get used to it pretty quickly. There is also some instances in BS where you have an UI attached to one hand and control it with the other, those work completely fine.

Though, as helpful as this is, I'm somewhat busy with getting the new UI done. Priority-wise I may not tackle this for a while... just to not give any false promises.

Yeah no worries, just thought about throwing in the idea. Appreciate all the effort you put into this!