Skip to content

Commit

Permalink
Add more parallellism
Browse files Browse the repository at this point in the history
  • Loading branch information
Plonq committed Feb 19, 2024
1 parent 46357cd commit 15ccd95
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ impl Plugin for PanOrbitCameraPlugin {
.add_systems(
Update,
(
active_viewport_data
.run_if(|active_cam: Res<ActiveCameraData>| !active_cam.manual),
(mouse_key_tracker, touch_tracker),
(
active_viewport_data
.run_if(|active_cam: Res<ActiveCameraData>| !active_cam.manual),
mouse_key_tracker,
touch_tracker,
),
pan_orbit_camera,
)
.chain()
Expand Down Expand Up @@ -375,6 +378,10 @@ fn active_viewport_data(
.expect("Must exist, since the camera is referencing it"),
};

// Is the cursor/touch in this window?
// Note: there's a bug in winit that causes `window.cursor_position()` to return
// a `Some` value even if the cursor is not in this window, in very specific cases.
// See: https://github.com/Plonq/bevy_panorbit_camera/issues/22
if let Some(input_position) = window.cursor_position().or(touches
.iter_just_pressed()
.collect::<Vec<_>>()
Expand Down

0 comments on commit 15ccd95

Please sign in to comment.