constructor(camera, onError) {
      this.camera = camera;
      this.vrDisplay;
      this.vrDisplays;
      this.standingMatrix = new Matrix4$1();
      this.frameData = null;

      if ('VRFrameData' in window) {
        this.frameData = new VRFrameData();
      }

      if (navigator.getVRDisplays) {
        navigator
          .getVRDisplays()
          .then((displays) => {
            this.vrDisplays = displays;
            if (displays.length > 0) {
              this.vrDisplay = displays[0];
            } else {
              if (onError) onError('VR input not available.');
            }
          })
          .catch(() => {
            console.warn('VRControls: Unable to get VR Displays');
          });
      }

      // the Rift SDK returns the position in meters
      // this scale factor allows the user to define how meters
      // are converted to scene units.
      this.scale = 1;

      // If true will use "standing space" coordinate system where y=0 is the
      // floor and x=0, z=0 is the center of the room.
      this.standing = false;

      // Distance from the users eyes to the floor in meters. Used when
      // standing=true but the VRDisplay doesn't provide stageParameters.
      this.userHeight = 1.6;
    }
@author dmarcos / https://github.com/dmarcos
@author mrdoob / http://mrdoob.com
@author halvves / https://github.com/halvves (i only es6 moduled it)