Skip to main content

drive_transform3d_pointer

Function drive_transform3d_pointer 

Source
pub fn drive_transform3d_pointer(
    state: ResMut<'_, Transform3dPointer>,
    layers: Query<'_, '_, (Entity, &ComputedNode, &UiGlobalTransform, &LayerTransform3dMatrix), With<PromotedLayer>>,
    ui_stack: Res<'_, UiStack>,
    pointers: Query<'_, '_, (&PointerId, &PointerLocation)>,
    windows: Query<'_, '_, &Window, With<PrimaryWindow>>,
    buttons: Res<'_, ButtonInput<MouseButton>>,
    input: MessageWriter<'_, PointerInput>,
)
Expand description

Remap the window cursor into the topmost visually-transformed layer under it and drive the virtual pointer there (PointerInput move/press/release, the surface driver’s contract). With no transformed layer under the cursor — or no transformed layers at all — the pointer parks off-bounds and releases owed presses.

Scheduled before bevy_picking’s input processing so the new location is consumed the same frame.