examples/resources/js/treasure-hunt.js
function updateAngles(xAngle, yAngle, zAngle) {
  let deg2rad = Math.PI / 180;
  let euler = new THREE.Euler(
    xAngle * deg2rad,
    yAngle * deg2rad,
    zAngle * deg2rad,
    'YXZ');
  let matrix = new THREE.Matrix4().makeRotationFromEuler(euler);
  camera.setRotationFromMatrix(matrix);
  if (!audioReady)
    return;

  if (Date.now() - lastMatrixUpdate > 100) {
    audioScene.setListenerFromMatrix(camera.matrixWorld);
  }
}
function updateAngles(xAngle, yAngle, zAngle) {
  let deg2rad = Math.PI / 180;
  let euler = new THREE.Euler(
    xAngle * deg2rad,
    yAngle * deg2rad,
    zAngle * deg2rad,
    'YXZ');
  let matrix = new THREE.Matrix4().makeRotationFromEuler(euler);
  camera.setRotationFromMatrix(matrix);
  if (!audioReady)
    return;

  if (Date.now() - lastMatrixUpdate > 100) {
    audioScene.setListenerFromMatrix(camera.matrixWorld);
  }
}
function updateAngles ( xAngle , yAngle , zAngle ) { let deg2rad = Math . PI / 180 ; let euler = new THREE . Euler ( xAngle * deg2rad , yAngle * deg2rad , zAngle * deg2rad , 'YXZ' ) ; let matrix = new THREE . Matrix4 ( ) . makeRotationFromEuler ( euler ) ; camera . setRotationFromMatrix ( matrix ) ; if ( ! audioReady ) return ; if ( Date . now ( ) - lastMatrixUpdate > 100 ) { audioScene . setListenerFromMatrix ( camera . matrixWorld ) ; } }
Compute rotation matrix.
@param {Number} xAngle
@param {Number} yAngle
@param {Number} zAngle
@private
Compute rotation matrix .