applyTorque method

void applyTorque(
  1. double torque
)

Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.

torque is usually in N-m.

Implementation

void applyTorque(double torque) {
  if (_bodyType != BodyType.dynamic) {
    return;
  }

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

  _torque += torque;
}