3 axis movement (flight) in WebXR

Hello!

Dabbling with WebXR in BabylonJS and loving it - thanks for a great framework.

I’ve stood up a simple example in WebXR with a floor mesh and teleportation disabled, and tested in the Oculus Quest - https://playground.babylonjs.com/#3IBMG7#1.

I had wrongly assumed that the default camera movement would be like it is in the playground on desktop. That we could move freely through all 3 axes (x,y, and z). Instead, we’re moving like an FPS. Makes sense, but I’m hoping to be able to fly!

So - my question. Is there any easy way to achieve this in XR?
Or will I have to write the code to have the controllers directly manipulate the camera? If so, I’ll give it a crack.

I’ve tried playing with customRegistrationConfigurations in the BABYLON.WebXRFeatureName.MOVEMENT feature, but the axisChangedHandler seems to only deal with the X and Y axes, so I’ve figure this is not a viable way to achieve it.

Any advice would be greatly appreciated!

Thanks,
Tim Farr

1 Like

Adding our VR/XR expert @RaananW

1 Like

Aren’t we all… :slight_smile:

I totally support that :slight_smile: Let me see how we can adjust the movement component to be closer to the freecamera’s keyboard “forward” movement.

1 Like

You can now fly like an eagle - [XR] Allow movement on the Y axis with controllers by RaananW · Pull Request #10951 · BabylonJS/Babylon.js (github.com)

(Only after it is merged and nightly was built :-))

3 Likes

Thanks RanaanW! That is amazing and works like a charm. Exactly what I’m after.

Really appreciate the work that you guys put in on this framework, and hope you have a smashing day.

Tim

3 Likes