createBody method

Body createBody()

You should create the Forge2D Body in this method when you extend the BodyComponent.

Implementation

Body createBody() {
  assert(
    bodyDef != null,
    'Ensure this.bodyDef is not null or override createBody',
  );
  final body = world.createBody(bodyDef!);
  fixtureDefs?.forEach(body.createFixture);
  return body;
}