Browse Source

improved touchDetection (works way better now)

Alexander Hendrich 11 years ago
parent
commit
cb86ccf772
1 changed files with 2 additions and 1 deletions
  1. 2 1
      bbiwarg/Detectors/Touch/TouchDetector.cs

+ 2 - 1
bbiwarg/Detectors/Touch/TouchDetector.cs

@@ -41,7 +41,8 @@ namespace bbiwarg.Detectors.Touch
         private float isTouchAt(int touchX, int touchY) {
             int searchSize = 15;
             int maxDepthDifference = 20;
-            Int16 depthAtTouch = depthImage.getDepthAt(touchX, touchY);
+            Int16 fingerDiameter = 5;
+            Int16 depthAtTouch = (Int16) (depthImage.getDepthAt(touchX, touchY) + fingerDiameter);
 
             int minX = Math.Max(touchX - searchSize, 0);
             int maxX = Math.Min(touchX + searchSize, depthImage.getWidth());