onApplyLinearForces method

Vector2 onApplyLinearForces(
  1. Iterable<Force2D> forces,
  2. Vector2 velocity,
  3. double dt
)

Implementation

Vector2 onApplyLinearForces(
  Iterable<Force2D> forces,
  Vector2 velocity,
  double dt,
) {
  return forces.fold<Vector2>(
    velocity,
    (p, e) => e.transform(p, mass, dt),
  );
}