setWith method

void setWith({
  1. T? hitbox,
  2. Ray2? reflectionRay,
  3. Vector2? normal,
  4. double? distance,
  5. bool isInsideHitbox = false,
})

Sets the values of the result from the specified arguments.

Implementation

void setWith({
  T? hitbox,
  Ray2? reflectionRay,
  Vector2? normal,
  double? distance,
  bool isInsideHitbox = false,
}) {
  _hitbox = hitbox;
  if (reflectionRay != null) {
    _reflectionRay.setFrom(reflectionRay);
  }
  if (normal != null) {
    _normal.setFrom(normal);
  }
  _distance = distance ?? double.maxFinite;
  _isInsideHitbox = isInsideHitbox;
}