Ejemplo n.º 1
0
 @Post(Params.returnIn0to1)
 public float getSchweifProximityAndUpdate(
     MousePath mousePath, Rectangle2D.Float rect, float cutoff) {
   float prox;
   if (rect.contains(mousePath.getCurrent())) {
     prox = 1;
   } else {
     float prox1 =
         getProximityToMouse(
             mousePath, new Point2D.Float((float) rect.getMaxX(), (float) rect.getMaxY()), cutoff);
     float prox2 =
         getProximityToMouse(
             mousePath, new Point2D.Float((float) rect.getMinX(), (float) rect.getMaxY()), cutoff);
     float prox3 =
         getProximityToMouse(
             mousePath, new Point2D.Float((float) rect.getMaxX(), (float) rect.getMinY()), cutoff);
     float prox4 =
         getProximityToMouse(
             mousePath, new Point2D.Float((float) rect.getMinX(), (float) rect.getMinY()), cutoff);
     prox = Math.max(Math.max(prox1, prox2), Math.max(prox3, prox4));
   }
   return getSchweifProximityAndUpdate(prox, mousePath.getTickDeltaTilLast());
 }
Ejemplo n.º 2
0
 @Post(Params.returnIn0to1)
 public float getProximityToMouse(
     MousePath mousePath, Point2D.Float objectPosition, float cutoff) {
   return getProximityToMouse((float) objectPosition.distance(mousePath.getCurrent()), cutoff);
 }
Ejemplo n.º 3
0
 @Post(Params.returnIn0to1)
 public float getSchweifProximityAndUpdate(
     MousePath mousePath, Point2D.Float objectPosition, float cutoff) {
   return getSchweifProximityAndUpdate(
       getProximityToMouse(mousePath, objectPosition, cutoff), mousePath.getTickDeltaTilLast());
 }