Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update controller property for Oculus Quest #4567

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

binzume
Copy link
Contributor

@binzume binzume commented May 2, 2020

Description:

The ray direction of oculus quest controller in the WebXR session is wrong. So adjusted direction and position.
The direction within WebVR API may will be broken, but the latest Oculus Browser no longer supports the WebVR.

Changes proposed:

@dmarcos
Copy link
Member

dmarcos commented May 2, 2020

what do you mean by wrong?

@binzume
Copy link
Contributor Author

binzume commented May 2, 2020

It seems that the controller's ray direction adjusted for earlier version of the OculusBrowser. (It actually worked correctly). However, there is now a difference from the direction of the ray on the home screen.
When using WebXR device API, the ray direction is provided by XRInputSource, so
the ray direction(and origin) should not be adjusted.

ray in Home:
com oculus vrshell-20200503-054620

A-Frame 1.0.4:
com oculus browser-20200503-054938

@dmarcos
Copy link
Member

dmarcos commented May 4, 2020

We should probably use XRInputSource.targetRaySpace for WebXR instead of hardcoded values

rayOrigin: {origin: {x: -0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},
modelPivotOffset: new THREE.Vector3(0, 0, 0),
rayOrigin: {origin: {x: 0, y: 0, z: 0}, direction: {x: 0, y: 0, z: -1}},
modelPivotOffset: new THREE.Vector3(0.01, 0.005, 0.03),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the model position need to be adjusted? I thought the problem was only with the ray position.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the model is slightly out of position. I adjusted the offset so that the model position does not change when entering/leaving VR.
However it is only tested on my Oculus Quest, so I'll also consider to reset the change.

Copy link
Member

@dmarcos dmarcos May 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to separate changes and put the model shift in a different PR if necessary. I still think that for the rayOrigin we should probably use InputSource values instead of hard coding numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late, I reverted the change for model shift.
Also, it seems that XRInputSource.targetRaySpace has already been applied to the pose of controllers. https://github.com/aframevr/aframe/blob/master/src/components/tracked-controls-webxr.js#L115 So rayOrigin and direction may not be needed if XRInputSource is available.

@dmarcos
Copy link
Member

dmarcos commented Nov 20, 2024

As mentioned, we should be using XRInputSource.targetRaySpace instead of hardcoded values. I'll leave it open as a reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants