setupPhysics method

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

Setup basic physics properties

Implementation

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

  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);
  }
}