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

XR integration #21

Open
krzysztofpniak opened this issue Dec 26, 2023 · 11 comments
Open

XR integration #21

krzysztofpniak opened this issue Dec 26, 2023 · 11 comments

Comments

@krzysztofpniak
Copy link

Do you have any hints How can I integrate with @react-three/xr ? I would like to use it as it works by default with additional support of VR, when when enter VR is clicked. Any hints are welcome.

@ErdongChen-Andrew
Copy link
Member

I'm also interested in integrating it with XR, but I haven't tried @react-three/xr yet. I'll give it a try when I get back to this project.

@CodyJasonBennett
Copy link
Member

You would have to manipulate the camera returned from https://threejs.org/docs/#api/en/renderers/webxr/WebXRManager.getCamera rather than the default camera. No other changes are needed.

@ErdongChen-Andrew
Copy link
Member

Thanks, @CodyJasonBennett! Good to know!

@antpb
Copy link

antpb commented Feb 9, 2024

@ErdongChen-Andrew in my project I got pretty stuck on this and the solution was to make sure you do
gl.xr.enabled = true; after you do the getCamera suggestion above or the headset wont follow movement or do any xr things

@ErdongChen-Andrew
Copy link
Member

Thank you, @antpb ! I'll definitely keep that in mind while I'm working on XR!

@tforde7
Copy link

tforde7 commented Feb 11, 2024

You would have to manipulate the camera returned from https://threejs.org/docs/#api/en/renderers/webxr/WebXRManager.getCamera rather than the default camera. No other changes are needed.

@CodyJasonBennett How exactly do I do this?

@jamesrez
Copy link

Yo, glad this is being worked on, been trying to make it work myself using @react-three/xr but I'm not able to get the movement / rotation right.
I was able to get the camera connected, but I'd like to be able to use the vr controllers.

left controller joystick to move around relative to where im facing (click in to sprint)
right controller joystick for rotating left and right
a button to jump

I noticed there was controller support added but doesn't seem to work with the xr controls.

anyways big thanks for the library @ErdongChen-Andrew hope you get around to this soon :)

@jamesrez
Copy link

Bumping this thread for priority

@CodyJasonBennett
Copy link
Member

PR welcome, and reminder open-source is voluntary community work.

@jamesrez
Copy link

PR welcome, and reminder open-source is voluntary community work.

Hey thanks for the bumping this thread again, I love open source, I can contribute what I can but I know there are those who are better at doing this than me and I wish they can do what they can as soon as possible. Will keep you updated in the PR i plan to create.

@cyango
Copy link

cyango commented May 14, 2024

How exactly would this work in XR? Using headset controllers? What about hands for example?

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

No branches or pull requests

7 participants