setZeroVelocity method

void setZeroVelocity({
  1. bool isX = true,
  2. bool isY = true,
})

Implementation

void setZeroVelocity({bool isX = true, bool isY = true}) {
  _velocity = _velocity.copyWith(
    x: isX ? 0.0 : _velocity.x,
    y: isY ? 0.0 : _velocity.y,
  );
  if (isX && isY) {
    velocityRadAngle = 0.0;
  }
}