removeFromWorld method

void removeFromWorld(
  1. World world
)

Remove the vehicle including its constraints from the world.

Implementation

void removeFromWorld(World world) {
  for(final key in particleBodies.keys){
    world.removeBody(particleBodies[key]!);
  }

  for (int i = 0; i < constraints.length; i++) {
    world.removeConstraint(constraints[i]);
  }
}