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){