physics Body
Registers the composable as a physics body and enables optional pointer-driven dragging.
Keys
key must be stable across recompositions (do not allocate new objects each frame) and unique within the same PhysicsBox container. Events use keys to map back to composables.
Dragging
If isDraggable is true, the engine may create a drag controller on pointer input. Drag behavior is defined by dragConfig. Drag callbacks (onDragStart, onDragEnd) are delivered with coordinates in container pixels (see DragEvent).
Collisions
If onCollision is provided, it will be invoked for contact events involving this body. Collision payload is described by CollisionEvent.
Performance notes
Event callbacks can be frequent. Keep handlers lightweight and avoid allocating per-event.
Parameters
Stable identifier used to bind the composable to a physics body and route events.
Physical properties (type, density, restitution, friction, etc.).
Collision shape used by the engine.
Collision filtering rules (category/mask/group or equivalent).
Enables pointer dragging for this body.
Drag tuning parameters (max force, spring frequency, damping, fling limits).
Optional body-level collision callback.
Optional callback invoked when the body enters/leaves “sleep” state (engine-specific; typically means it stopped moving and is excluded from simulation work).
Optional callback invoked when a drag starts for this body.
Optional callback invoked when a drag ends (including cancel).