From d193aa46ec80a58a6a6ad619c38619e434a6137a Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 5 Apr 2026 18:12:51 +0200 Subject: feat(engine): add position to mouse component --- engine/src/windowing/mouse.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engine/src/windowing/mouse.rs') diff --git a/engine/src/windowing/mouse.rs b/engine/src/windowing/mouse.rs index 1afe594..3b08443 100644 --- a/engine/src/windowing/mouse.rs +++ b/engine/src/windowing/mouse.rs @@ -6,9 +6,17 @@ use crate::vector::Vec2; #[derive(Debug, Default, Clone, Sole)] #[non_exhaustive] -pub struct Motion +pub struct Mouse { - pub position_delta: Vec2, + /// Change in coordinates this tick. Unit is unspecified and platforms may use + /// different units. Updated automatically by the [`windowing extension`]. + /// + /// [`windowing extension`]: crate::windowing + pub curr_tick_position_delta: Vec2, + + /// Coordinates in pixels relative to the top-left corner of the window. May have + /// been affected by cursor acceleration + pub position: Vec2, } /// Mouse buttons. -- cgit v1.2.3-18-g5258