pmndrs / ecctrl

🕹️ A floating rigibody character controller
MIT License
467 stars 50 forks source link

XR integration #21

Open krzysztofpniak opened 6 months ago

krzysztofpniak commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

Thanks, @CodyJasonBennett! Good to know!

antpb commented 5 months ago

@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 commented 5 months ago

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

tforde7 commented 5 months ago

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 commented 4 months ago

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 commented 3 months ago

Bumping this thread for priority

CodyJasonBennett commented 3 months ago

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

jamesrez commented 3 months ago

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 commented 1 month ago

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