addImpulse method

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

Changes body's velocity at once (N·s).

Implementation

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