setMass method

void setMass(
  1. double mass
)

Set mass of the object

Implementation

void setMass(double mass) {
  assert(mass > 0, 'Mass must be positive');
  _mass = mass;
}