_onXrFrame (timestamp, xrFrame) {
      const { xrSession, offsetReferenceSpace, threeObject: mainCam } = this
      const pose = offsetReferenceSpace && xrFrame.getViewerPose(offsetReferenceSpace)

      if (pose && xrSession && xrSession.renderState.baseLayer) {
        const views = pose.views
        const viewCameras = mainCam.cameras

        // Remove extra cameras if the count is decreasing
        while (viewCameras.length > views.length) {
          mainCam.layers.disable(viewCameras.length--)
        }

        // Update each eye view
        for (let i = 0; i < views.length; i++) {
          const view = views[i]
          let viewCam = viewCameras[i]

          // Create the view's sub-camera if needed
          if (!viewCam) {
            viewCam = viewCameras[i] = new PerspectiveCamera()
            viewCam.viewport = new Vector4()
            // Match the ThreeJS convention of layer masks per eye
            viewCam.layers.enable(i + 1)
            mainCam.layers.enable(i + 1)
          }

          // Update the sub-camera viewport and matrices to match the view
          const viewport = xrSession.renderState.baseLayer.getViewport(view)
          viewCam.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height)
          viewCam.matrixWorld.fromArray(view.transform.matrix)
          viewCam.matrixWorldInverse.fromArray(view.transform.inverse.matrix)
          viewCam.projectionMatrix.fromArray(view.projectionMatrix)
        }

        // We also need to make the main camera match an overall pose/projection for use in
        // frustum culling etc. For now let's just copy the first view's data.
        // TODO this isn't good enough for the frustum, it results in overaggressive culling from the right eye.
        //  Should use a combined frustum once available from API (https://github.com/w3c/webvr/issues/203)
        //  or calculate it ourselves like ThreeJS does with WebVRUtils.setProjectionFromUnion
        if (views.length === 2) {
          setProjectionFromUnion(mainCam, viewCameras[0], viewCameras[1])
        }
      }
    }
Handle syncing the cameras to the current XRFrame's pose data