epadBoxSet(gamepad.buttons.length, gamepad.axes.length);
          scene.addNode(boxTable[hand]);
        }

        boxTable[hand].update_state(gamepad);

        // Update the pose of the boxes to sync with the controller.
        if (pose) {
          boxTable[hand].matrix = pose.transform.matrix;
        }
      }

      // Don't bother starting an inline session in this sample since WebXR
      // gamepads are not available during inline sessions.
      function initXR() {
        xrButton = new WebXRB