From 7f68fd9b21865ea39cffdbca7490dff782fec10a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 30 Jul 2024 19:19:32 -0700 Subject: [PATCH] more --- src/physics_worker.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/physics_worker.rs b/src/physics_worker.rs index 60c9866..33ff4fd 100644 --- a/src/physics_worker.rs +++ b/src/physics_worker.rs @@ -37,12 +37,16 @@ impl MouseInterpolator{ //The first element is guaranteed to exist. let mut iter=self.queue.iter(); //find a mouse input - 'outer: loop{ + 'outer:loop{ match iter.next(){ Some(ins0)=>{ let physics_input=match &ins0.instruction{ InputInstruction::MoveMouse(mouse0)=>{ - loop{ + //mouse instruction found. + //enter a new loop with different behaviour + //we have to wait for the next mouse event + //so there is a before and after interpolation target + 'inner:loop{ match iter.next(){ Some(ins1)=>match ins1.instruction{ InputInstruction::MoveMouse(mouse1)=>{ @@ -52,8 +56,13 @@ impl MouseInterpolator{ //drain and handle the elements from the front break 'outer; }, - _=>{ - //TODO: 10msif Time::from_millis(10){