<p dir="auto">In WebVR one could simply use <code class="notranslate">camera.getWorldDirection()</code> to find the direction in which the camera is pointed in VR. As of r113, in WebXR this same call returns information about the parent rig of the camera, rather than the camera, at least in Oculus browser on both Quest and Go.</p>
<p dir="auto">The culprit is the line <code class="notranslate">this.updateMatrixWorld( true )</code> in the function, because without it the correct camera information is returned. I can't see any recent changes in <code class="notranslate">camera.updateMatrixWorld</code> that would cause the change. Is this just expected behavior in WebXR vs WebVR? If so then <code class="notranslate">camera.getWorldDirection</code> is not useful in this context.</p>
<h5 dir="auto">Description of the problem</h5>
<p dir="auto">If an object has an onBeforeRender function which calls getWorldPosition on the <code class="notranslate">camera</code> argument, and the user is in VR, then that object (and any rendered after it) will stick to the user's face, as though the VR camera jumped to the origin mid-render.</p>
<p dir="auto">Example: <a href="https://ravenworks.ca/temp/threeOBRcamerabug/" rel="nofollow">https://ravenworks.ca/temp/threeOBRcamerabug/</a></p>
<h5 dir="auto">Three.js version</h5>
<p dir="auto">r112 (and some earlier, though I'm not sure exactly where it broke; this used to work in 2017, but it doesn't now.)</p>
<h5 dir="auto">Browser</h5>
<p dir="auto">my demo only runs in Chrome because of Three dropping WebVR support, but the same bug happens in Firefox if using A-Frame (that's how I discovered the bug)</p>
<h5 dir="auto">OS</h5>
<p dir="auto">only tried on Windows 10</p>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>
<p dir="auto">Oculus Rift</p>