ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
353 stars 82 forks source link

Changing the distance of dragged objects #45

Closed JeffBail closed 6 years ago

JeffBail commented 6 years ago

I really like the way Oculus Dash allows you to pick up a window, drag it around and then move it closer or further away from you so you can hang it in just the right position and size. I'm going to play around with adding support for this in Draggable.cs from the 3DDrag example. Although I'm using Dash as an example I'm not planning on working with windows or desktops from the OS; I'm just going to move around GameObjects which are already in the scene. If anyone has worked on something similar or has suggestions on a better way to go about it please let me know. One initial concern I have is recognizing which controller is doing the dragging; for now I think I'll assume everything is right handed.

JeffBail commented 6 years ago

I've made some progress on this and I'll submit a pull request when I have something put together.

lawwong commented 6 years ago

6ba68b49ac90d2dbfc64e2735d2e5b09b772734c

JeffBail commented 6 years ago

Thanks so much for refactoring this class with the scroll support and sorry I never submitted a PR for my work; although the prototype was working I didn't get the chance to fully debug it. I did submit Pull Request #50 for Issue #49 which is a simple fix to allow the scroll delta to be tuned. I found that in my scene I had objects that were really far away which were difficult to scroll effectively without changing the delta. I made the delta a member of the class so it can be easily changed and live tuned in the Editor.