ecctrl icon indicating copy to clipboard operation
ecctrl copied to clipboard

XR integration

Open krzysztofpniak opened this issue 1 year ago • 9 comments

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.

krzysztofpniak avatar Dec 26 '23 21:12 krzysztofpniak

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.

ErdongChen-Andrew avatar Dec 27 '23 22:12 ErdongChen-Andrew

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 avatar Jan 04 '24 04:01 CodyJasonBennett

Thanks, @CodyJasonBennett! Good to know!

ErdongChen-Andrew avatar Jan 04 '24 22:01 ErdongChen-Andrew

@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

antpb avatar Feb 09 '24 06:02 antpb

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

ErdongChen-Andrew avatar Feb 10 '24 01:02 ErdongChen-Andrew

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?

tforde7 avatar Feb 11 '24 12:02 tforde7

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 avatar Feb 14 '24 20:02 jamesrez

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

CodyJasonBennett avatar Mar 27 '24 02:03 CodyJasonBennett

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

joaomelorodrigues avatar May 14 '24 14:05 joaomelorodrigues