addAngularImpulse method

  1. @override
void addAngularImpulse(
  1. int body,
  2. Vector3 impulse
)
override

Changes body's spin at once (N·m·s).

Implementation

@override
void addAngularImpulse(int body, Vector3 impulse) {
  final b = bodies[body];
  if (b == null || b.type != BodyType3D.dynamic) return;
  b.angularVelocity.addScaled(impulse, 1 / b.mass);
  _wake(b);
}