addToWorld method

void addToWorld(
  1. World world
)

Add the vehicle including its finalraints to the world.

Implementation

void addToWorld(World world){
  world.addBody(chassisBody);
  final that = this;
  preStepCallback = (event){
    that.updateVehicle(world.dt);
  };
  world.addEventListener('preStep', preStepCallback);
  this.world = world;
}