applyTorque method

void applyTorque(
  1. Vec3 torque
)

Apply torque to the body. @param torque The amount of torque to add.

Implementation

void applyTorque(Vec3 torque){
  if (type != BodyTypes.dynamic) {
    return;
  }

  if (sleepState == BodySleepStates.sleeping) {
    wakeUp();
  }

  // Add rotational force
  this.torque.vadd(torque, this.torque);
}