Explorar o código

improved touchDetection (works way better now)

Alexander Hendrich %!s(int64=11) %!d(string=hai) anos
pai
achega
cb86ccf772
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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());