applyWheelForce method

void applyWheelForce(
  1. double value,
  2. int wheelIndex
)

Apply a torque on one of the wheels.

Implementation

void applyWheelForce(double value, int wheelIndex) {
  final axis = wheelAxes[wheelIndex];
  final wheelBody = wheelBodies[wheelIndex];
  final bodyTorque = wheelBody.torque;

  axis.scale(value, _torque);
  wheelBody.vectorToWorldFrame(_torque, _torque);
  bodyTorque.vadd(_torque, bodyTorque);
}