applyForceToCenter method

void applyForceToCenter (Vector2 force)

Apply a force to the center of mass. This wakes up the body.

@param force the world force vector, usually in Newtons (N).

Implementation

void applyForceToCenter(Vector2 force) {
  if (_bodyType != BodyType.DYNAMIC) {
    return;
  }

  if (isAwake() == false) {
    setAwake(true);
  }

  _force.x += force.x;
  _force.y += force.y;
}