aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

controller stays at 0 0 0 when camera is set at another position #2230

Closed giordyb closed 7 years ago

giordyb commented 7 years ago

Description:

The Oculus Touch controllers stay relative to 0 0 0 even though the camera has been set at a different position during loading of the scene.

this is a demo scene with the oculus touch enabled and the camera set to 0 0 0 http://www.pippistarace.it/aframe/helloworld1.html

this is another demo scene where the camera has been set at a different location. I would expect the touch controller to somehow be relative to the camera but instead they stay at 0 0 0 and can be seen from a distance http://www.pippistarace.it/aframe/helloworld2.html

machenmusik commented 7 years ago

I didn't change any of the tracked-controls position logic in the recent refactor, so I expect this would have been true previously as well... but I think the issue with the second scene is that the camera is specifically offset from the controllers due to the non-shared parent entity, so I think it is working as expected... @dmarcos @fernandojsg thoughts?

giordyb commented 7 years ago

well the issue that I am having is that my scene is dynamically generated and the camera starts somewhere far from 0 0 0. Is there a way to move the controllers or give them a starting location as well?

machenmusik commented 7 years ago

you should be able to give them a position, @fernandojsg added that before I got here IIRC

giordyb commented 7 years ago

you are correct, if I set a similar position as the camera then the controllers show up. I did try it before but I did not realize that if I set the SAME position as the camera the controllers end up a little behind and cannot be seen. Once I saw their position in the inspector I was able to correct it.

One issue that I found is that if I start with the camera rotated by a certain amount (i.e. 90 degrees) then the controllers will always be facing the wrong direction, even if I specify the same rotation as the camera.

Another issue that I found is that changing the position completely breaks the teleport-controls, every press seems to teleport somewhere else instead of the target at the end of the arc.

I've added the teleport controls to the two html files so that you can try it out

machenmusik commented 7 years ago

you can see how i am using teleport in my gallery example... yeah i don't think there is rotation offset support in tracked-controls - not sure how far we should go, feels like a better control of roomspace may be helpful rather than these one-offs

machenmusik commented 7 years ago

not sure if but if camera and controllers have shared parent that has rotation offset but position is done to each child individually, that may work for now including for teleport? i think the teleport code needs to understand world to local conversion when computing position offset

machenmusik commented 7 years ago

@giordyb sounds like the remaining issue you are having is really with teleport controls and not with tracked controllers anymore? should we edit title and/or close this issue?

caseyyee commented 7 years ago

What browser are you using? With Firefox Nightly, there is an issue with the Oculus Touch controllers positions being offset: https://bugzilla.mozilla.org/show_bug.cgi?id=1324149 I suspect this is the issue you are seeing since i'm getting the same result. Works fine with VIVE.

machenmusik commented 7 years ago

is the behavior from Nightly correct? i would expect that if (direct) oculus support is enabled, openvr should not be used for oculus devices?

giordyb commented 7 years ago

@machenmusik yes, it looks like the issue is limited to the teleport controls, I believe we can close the issue. @caseyyee I did all my tests with chromium for webvr.

caseyyee commented 7 years ago

@machenmusik Currently Oculus touch controllers in Nightly are only supported through OpenVR -- though that's going to be changing soon so that that the API works directly with Oculus instead. If you disable openVR, you get headset support, but touch controllers won't work.

@giordyb ah interesting. Could be something with A-Frame then. Chromium should be fine.

machenmusik commented 7 years ago

I can't close this issue. But... @giordyb I believe I have a fix in chenzlabs/aframe-teleport-controls

@caseyyee any way to try out the direct support in upcoming Nightly to make sure there aren't any discrepancies?

caseyyee commented 7 years ago

@machenmusik Oculus touch is not functional with Nightly right now because of the issues. We'll want to wait till it's fixed before using it.

giordyb commented 7 years ago

@machenmusik I tried the teleport control version that you mentioned but I think it's broken, even at 0 0 0 i'm not getting anything when I press the trigger, and all I did was replacing the JS script

machenmusik commented 7 years ago

@giordyb you should close this issue and we should move the discussion to teleport-controls projects... were you using my version before, or @fernandojsg ? mine changed to use hand gesture events, so if you were using @fernandojsg then you need to change some of the parameters

giordyb commented 7 years ago

@machenmusik agreed, I will close the issue.