setup method

void setup({
  1. double? mass,
  2. double? dragCoefficient,
  3. bool? enabled,
  4. Vector2? gravity,
  5. Vector2? wind,
  6. Vector2? friction,
})

Implementation

void setup({
  double? mass,
  double? dragCoefficient,
  bool? enabled,
  Vector2? gravity,
  Vector2? wind,
  Vector2? friction,
}) {
  _isEnabled = enabled ?? _isEnabled;

  if (mass != null) {
    setMass(mass);
  }
  if (dragCoefficient != null) {
    setDragCoefficient(dragCoefficient);
  }

  if (gravity != null) {
    setGravity(gravity);
  }
  if (wind != null) {
    setWind(wind);
  }
  if (friction != null) {
    setFriction(friction);
  }
}