webXR camera position always zero


This is always zero (0,0,0) no matter where I move around when in webxr, any idea why?

I am trying to get the webxr world camera position.

I saw this issue, Object3D.getWorld*() with cameras do not work when WebXR is presenting. · Issue #18448 · mrdoob/three.js · GitHub, maybe it is related

I am trying to bumpbumpbump

In VR mode the headset controls the camera position directly by setting the matrixWorld. So, high-level properties like position cannot be used to get the position. Instead, the camera position is extracted from matrixWorld.

However, positioning the camera in VR has two aspects. The one described above is the local position of the camera as managed by the VR headset – it changes when you move your head. If you walk virtually in the scene by using the controllers (e.g. teleportation or any other virtual movement), this is implemented by putting the camera in another Object3D and moving that object. So, the global position of the camera can be taken from the position of that object.

What if the user takes a step to the left. How do we get that new position?
The position of the Object3D parent position is not useful for precise VR camera position.

The value of ‘matrixWorld’ should provide info for the VR headset motion. I don’t have a VR set right now to try it, but this is what I remember. If you extract the translation vector from this matrix, does it change while the users takes steps?