ExtendRealityLtd / VRTK

An example of how to use the Tilia packages to create great content with VRTK v4.
https://www.vrtk.io/
MIT License
3.69k stars 1k forks source link

Secondary controller vertical rotation issue #714

Closed azinicus closed 7 years ago

azinicus commented 7 years ago

When working with the secondary controller example, there is a use case where when rotating an object with both hands, at vertical orientations (of the controllers) the object will start unnaturally rotating on the y-axis (World Space). This is problematic if you want to have an experience where users are using two hands to move and rotate objects. Here's a video of the issue in action.

xEvoGx commented 7 years ago

Yea I was going to mention this too (on that exact object). I'm under the assumption that that was far from final or is that it?

azinicus commented 7 years ago

The current demo scene is now fully incorporated into VRTK's main repo, but we haven't been able to find a simple fix for this issue yet.

thestonefox commented 7 years ago

@xEvoGx this issue would be considered an enhancement or a new secondary controller action.

The current one just uses LookRotation to move the object, which is going to cause unity issues when you move it into an origin position.

The current one is "good enough" for most cases, but a more detailed version would also be good.

xEvoGx commented 7 years ago

To avoid this issue we would need to capture the primary hands (e.g. the hand holding the grip of a rifle) Up Vector (+Y) and apply that after the look at, no?

A held object would never roll (using the pitch/roll/yaw concept) away from the hand so this should work just fine.

xEvoGx commented 7 years ago

So yea I took another peek at H3VR and yea they do exactly that. Roll (+Y) is locked to the hand while Pitch and Yaw are free to 'aim' towards the secondary hand which is nothing more than a pivot point.

Just food for thought.

thestonefox commented 7 years ago

Yeah I think having the Roll Y locked is probably a good idea. I did try and do that when I initially wrote the code but couldn't get it working.

If anyone has a way of getting it to lock then please let me know

thestonefox commented 7 years ago

Should be fixed with https://github.com/thestonefox/VRTK/commit/eb89a13f5460c5a71cf928b5f18f3dd0d2e59ee2