react-xr icon indicating copy to clipboard operation
react-xr copied to clipboard

First person setup with physics

Open dreammonkey opened this issue 2 years ago • 0 comments

Hey,

I've created a basic setup in which I created a first person controller and added physics to it. The demo works fine. But I believe my setup might be entirely wrong.

Right now moving around using the controllers works well (left controller for moving, right controller for rotating). But when turning your head or your entire body the experience is wrong and directions no longer correlate with reality.

It is also possible to walk away from / step out of the physics collider ... Right now the player object is being put at the position of the collider every frame. But maybe the collider should be put inside of the player group ? All this is a bit confusing.

As these are my first steps in VR (and rapier) I'm mostly looking for some pointers. Any advice is much appreciated !

Here is the link to the sandbox: https://codesandbox.io/s/r3f-xr-rapier-first-person-2uxdyb?file=/src/components/RapierScene.tsx

dreammonkey avatar Nov 03 '22 11:11 dreammonkey