File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,32 +54,21 @@ public Vector2 Filter(Vector2 point)
5454 {
5555 // Move buffer positions and current position towards the latest target using linear interpolation
5656 // Amount of movement is the distance ratio between threshold and maximum
57- // var bufEnum = _buffer.GetEnumerator();
58-
59- // buffer.LerpAdd()
60- // while (bufEnum.MoveNext())
61- // {
62- // bufEnum.Current.X += (float)((point.X - bufEnum.Current.X) * distanceRatio);
63- // bufEnum.Current.Y += (float)((point.Y - bufEnum.Current.Y) * distanceRatio);
64- // }
6557
6658 var bufNode = _buffer . First ;
6759
6860 while ( bufNode != null )
6961 {
7062 var bufPoint = bufNode . Value ;
71- bufPoint . X = ( float ) ( ( point . X - bufPoint . X ) * distanceRatio ) ;
72- bufPoint . Y = ( float ) ( ( point . Y - bufPoint . Y ) * distanceRatio ) ;
63+ bufPoint . X + = ( float ) ( ( point . X - bufPoint . X ) * distanceRatio ) ;
64+ bufPoint . Y + = ( float ) ( ( point . Y - bufPoint . Y ) * distanceRatio ) ;
7365 bufNode . Value = bufPoint ;
7466 bufNode = bufNode . Next ;
7567 }
7668
77- // outputPosition.LerpAdd()
7869 _lastPoint . X += ( float ) ( ( point . X - _lastPoint . X ) * distanceRatio ) ;
7970 _lastPoint . Y += ( float ) ( ( point . Y - _lastPoint . Y ) * distanceRatio ) ;
8071
81- // New logging feature available only in TDPlugin 0.3.2
82- // Log.Write("NoiseReduction", "Noise Reduced! " + _lastPoint, LogLevel.Debug);
8372 return _lastPoint ;
8473 }
8574 }
You can’t perform that action at this time.
0 commit comments