enqueueImpulse

fun enqueueImpulse(key: Any, impulseXPx: Float, impulseYPx: Float, wake: Boolean = true)

Queues a linear impulse for the body associated with key.

Impulse components are expressed in container pixels (Px) and converted internally to physics impulse units by the runtime dev.zinchenko.physicsbox.units.PhysicsUnits.

Parameters

key

Body key used in Modifier.physicsBody(key = ...).

impulseXPx

Impulse X component in container pixels (Px).

impulseYPx

Impulse Y component in container pixels (Px).

wake

Whether to wake the body if the backend supports sleeping.