onMouseMove method

dynamic onMouseMove(
  1. dynamic event
)

Implementation

onMouseMove(event) {
  print("onMouseMove event: $event isLocked ${scope.isLocked} ");
  if (scope.isLocked == false) return;

  var movementX = event.movementX ?? event.mozMovementX ?? event.webkitMovementX ?? 0;
  var movementY = event.movementY ?? event.mozMovementY ?? event.webkitMovementY ?? 0;

  _euler.setFromQuaternion(camera.quaternion);

  _euler.y -= movementX * 0.002 * scope.pointerSpeed;
  _euler.x -= movementY * 0.002 * scope.pointerSpeed;

  _euler.x = Math.max(_pi2 - scope.maxPolarAngle, Math.min(_pi2 - scope.minPolarAngle, _euler.x));

  camera.quaternion.setFromEuler(_euler);

  scope.dispatchEvent(_changeEvent);
}