WebXR - Snap turning problem & smooth locomotion

WhiIe looking up how to do snap turning in BabylonJS, I came across this playground: https://playground.babylonjs.com/#INBVUY#102
There is a flaw in it that the camera is rotating around its local Y axis, not the world axis, so you begin to list very quickly when snap turning.

One way I’ve thought of fixing it was to save off the current HMD’s rotation, zero it out, apply the turn, then re-apply the local rotation. But I thought I should ask to see if there is a better way to go about this.

I should point out that my goal is first to implement the standard smooth locomotion controls. That is, left thumbstick for forward/back/left/right and the right thumbstick for either smooth or snap turning. However, I also want to allow the user to remap the keys so that they can swap those controls if they wish.

Is there a different playground I could look at for an example for smooth locomotion?

I think I may have found what I’m looking for in the documentation. I’ll be playing with this today to see.

I think I didn’t come across this because I wasn’t looking for “Features”, I was looking for “Locomotion”.

1 Like

Yes, this was exactly what I needed!

1 Like