Physics Command
Commands produced by UI/layout code and consumed by the runtime physics backend.
Commands are enqueued via PhysicsBoxState.enqueueCommand (or its convenience helpers) and drained by the runtime integration.
Naming convention:
fields with
Px/PxPerSecsuffix are expressed in container pixel spacefields without suffix are interpreted by the runtime (often physics/world units)
Inheritors
Types
Link copied to clipboard
data class BeginDrag(val key: Any, val grabPointPx: PhysicsVector2, val pointerId: Long? = null, val targetPx: PhysicsVector2, val dragConfig: DragConfig) : PhysicsCommand
Begins a drag interaction for a body.
Link copied to clipboard
Cancels an active drag interaction.
Link copied to clipboard
Ends a drag interaction and provides release velocity.
Link copied to clipboard
data class EnqueueImpulse(val key: Any, val impulseX: Float, val impulseY: Float, val wake: Boolean = true) : PhysicsCommand
Applies a linear impulse to a body.
Link copied to clipboard
data class EnqueueVelocity(val key: Any, val velocityX: Float, val velocityY: Float) : PhysicsCommand
Sets/overwrites linear velocity of a body.
Link copied to clipboard
Requests a full runtime world reset.
Link copied to clipboard
Updates world gravity vector.
Link copied to clipboard
Updates drag target for an active drag interaction.