applyLinearImpulse method
Applies impulse at world point, or at the center of mass when
point is omitted, immediately changing the linear velocity.
Implementation
void applyLinearImpulse(Vector2 impulse, {Vector2? point, bool wake = true}) {
if (point == null) {
rawBox2D.bodyApplyLinearImpulseToCenter(
index1,
worldAndGeneration,
impulse.x,
impulse.y,
wake: wake,
);
} else {
rawBox2D.bodyApplyLinearImpulse(
index1,
worldAndGeneration,
impulse.x,
impulse.y,
point.x,
point.y,
wake: wake,
);
}
}