panBy method

void panBy(
  1. Offset fraction
)

Pans the target across the view by fraction of the viewport (its components in [-1, 1]), scaled by distance so the world tracks the drag.

Implementation

void panBy(Offset fraction) {
  final forward = (_targetGoal - _eyeFor(_targetGoal)).normalized();
  final right = Vector3(0.0, 1.0, 0.0).cross(forward)..normalize();
  final up = forward.cross(right)..normalize();
  final shift =
      (right * -fraction.dx + up * fraction.dy) * (_distance * panSpeed);
  _targetGoal += shift;
}