yaw method

void yaw(
  1. double angle, {
  2. bool rotateAroundTarget = false,
})

Implementation

void yaw(double angle, {bool rotateAroundTarget = false}) {
  final targetPosition = (target - position)..applyAxisAngle(up, angle);

  if (rotateAroundTarget) {
    position.setValues(
      target.x - targetPosition.x,
      target.y - targetPosition.y,
      target.z - targetPosition.z,
    );
  } else {
    target.setValues(
      position.x + targetPosition.x,
      position.y + targetPosition.y,
      position.z + targetPosition.z,
    );
  }
}