浏览代码

improved fingerDetection

Alexander Hendrich 11 年之前
父节点
当前提交
ee5748b53c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      bbiwarg/Detectors/Fingers/FingerDetector.cs

+ 2 - 2
bbiwarg/Detectors/Fingers/FingerDetector.cs

@@ -88,8 +88,8 @@ namespace bbiwarg.Detectors.Fingers
 
 
             FingerSliceTrail trail = new FingerSliceTrail(startSlice);
             FingerSliceTrail trail = new FingerSliceTrail(startSlice);
 
 
-            Vector2D position = startSlice.Mid + startDirection;
             Vector2D direction = startDirection;
             Vector2D direction = startDirection;
+            Vector2D position = startSlice.Mid + 2*direction;
 
 
             if (position.isWithin(0, 0, maxX, maxY))
             if (position.isWithin(0, 0, maxX, maxY))
             {
             {
@@ -128,7 +128,7 @@ namespace bbiwarg.Detectors.Fingers
             FingerSlice lastSlice = trail.End;
             FingerSlice lastSlice = trail.End;
             FingerSlice nextSlice;
             FingerSlice nextSlice;
 
 
-            while (currentPosition.isWithin(0, 0, maxX, maxY) && gapCounter <= Math.Min(numSlices / 2, 10))
+            while (currentPosition.isWithin(0, 0, maxX, maxY) && gapCounter <= Math.Min(numSlices, 10))
             {
             {
                 nextSlice = findFingerSliceFromMid(currentPosition, currentDirection);
                 nextSlice = findFingerSliceFromMid(currentPosition, currentDirection);
                 if (nextSlice != null && (nextSlice.Length < lastSlice.Length + 5 && nextSlice.Length > lastSlice.Length - 5))
                 if (nextSlice != null && (nextSlice.Length < lastSlice.Length + 5 && nextSlice.Length > lastSlice.Length - 5))