applyGravity method

Offset applyGravity(
  1. Offset velocity
)

Implementation

Offset applyGravity(Offset velocity)
{
  // mass is assumed to be 1 until further extension.
  // ideally, particles do not need to define a mass unless the physics package is being used.

  double newVerticalVelocity = velocity.dy + gravityScale * (10/60);

  return Offset(velocity.dx, newVerticalVelocity);
}