applyForce method

void applyForce(
  1. Vector2 force, {
  2. Vector2? point,
})

Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This wakes up the body.

point is the world position of the point of application (default: center of mass)

Implementation

void applyForce(Vector2 force, {Vector2? point}) {
  point ??= worldCenter;
  _applyForceToCenter(force);
  _torque +=
      (point.x - sweep.c.x) * force.y - (point.y - sweep.c.y) * force.x;
}