Wersja działająca.Raczej
This commit is contained in:
@@ -514,7 +514,7 @@ public class GeomUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static final float PRZEKATNA_MK = MapConsts.DL_MK * (float) Math.sqrt(2);
|
||||
private static final float PRZEKATNA_MK = MapConsts.SS_SIZE * (float) Math.sqrt(2);
|
||||
|
||||
/**
|
||||
* Funkcja wyznacza odległość między środkami kwadratów sąsiednich na zadanym kierunku
|
||||
@@ -528,7 +528,7 @@ public class GeomUtils {
|
||||
case SOUTH:
|
||||
case EAST:
|
||||
case WEST:
|
||||
return MapConsts.DL_MK;
|
||||
return MapConsts.SS_SIZE;
|
||||
case NORTHEAST:
|
||||
case NORTHWEST:
|
||||
case SOUTHEAST:
|
||||
@@ -860,8 +860,8 @@ public class GeomUtils {
|
||||
float dyf = (float) dy;
|
||||
a = dyf / dxf;
|
||||
// wspolrzedne srodka kwadratu (xp, yp)
|
||||
int xxp = xp * MapConsts.DL_MK + MapConsts.DL_MK / 2;
|
||||
int yyp = yp * MapConsts.DL_MK + MapConsts.DL_MK / 2;
|
||||
int xxp = xp * MapConsts.SS_SIZE + MapConsts.SS_SIZE / 2;
|
||||
int yyp = yp * MapConsts.SS_SIZE + MapConsts.SS_SIZE / 2;
|
||||
b = yyp - a * xxp;
|
||||
|
||||
if (dx > 0) {
|
||||
@@ -877,14 +877,14 @@ public class GeomUtils {
|
||||
int xd, xg;
|
||||
int yd, yg;
|
||||
int y1, y2;
|
||||
xd = (x - 1) * MapConsts.DL_MK;
|
||||
xg = x * MapConsts.DL_MK;
|
||||
xd = (x - 1) * MapConsts.SS_SIZE;
|
||||
xg = x * MapConsts.SS_SIZE;
|
||||
float ydf = a * xd + b;
|
||||
float ygf = a * xg + b;
|
||||
yd = (int) ydf;
|
||||
yg = (int) ygf;
|
||||
y1 = yd / MapConsts.DL_MK + 1;
|
||||
y2 = yg / MapConsts.DL_MK + 1;
|
||||
y1 = yd / MapConsts.SS_SIZE + 1;
|
||||
y2 = yg / MapConsts.SS_SIZE + 1;
|
||||
temp[dl] = new Coord.Grid();
|
||||
temp[dl].x = x;
|
||||
temp[dl].y = y1;
|
||||
@@ -1225,7 +1225,7 @@ public class GeomUtils {
|
||||
int yy = p1.y - p2.y;
|
||||
yy *= yy;
|
||||
float odl = (float) Math.sqrt(xx + yy);
|
||||
odl *= MapConsts.DL_MK;
|
||||
odl *= MapConsts.SS_SIZE;
|
||||
return odl;
|
||||
}
|
||||
|
||||
@@ -1245,7 +1245,7 @@ public class GeomUtils {
|
||||
int yy = y1 - y2;
|
||||
yy *= yy;
|
||||
float odl = (float) Math.sqrt(xx + yy);
|
||||
odl *= MapConsts.DL_MK;
|
||||
odl *= MapConsts.SS_SIZE;
|
||||
return odl;
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ public class GeomUtils {
|
||||
*/
|
||||
public static float odleglosc(int dx, int dy) {
|
||||
float odl = (float) Math.sqrt(dx * dx + dy * dy);
|
||||
odl *= MapConsts.DL_MK;
|
||||
odl *= MapConsts.SS_SIZE;
|
||||
return odl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user