geforkt von Mirrors/FastAsyncWorldEdit
Fix ellipsoid selection
Dieser Commit ist enthalten in:
Ursprung
a23abc1bb6
Commit
69ae4a7121
@ -55,7 +55,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
|||||||
|
|
||||||
//FAWE start
|
//FAWE start
|
||||||
private Vector3 radiusSqr;
|
private Vector3 radiusSqr;
|
||||||
private Vector3 inverseRadius;
|
private Vector3 inverseRadiusSqr;
|
||||||
private int radiusLengthSqr;
|
private int radiusLengthSqr;
|
||||||
private boolean sphere;
|
private boolean sphere;
|
||||||
//FAWE end
|
//FAWE end
|
||||||
@ -200,7 +200,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
|||||||
radiusSqr = radius.multiply(radius);
|
radiusSqr = radius.multiply(radius);
|
||||||
radiusLengthSqr = (int) radiusSqr.getX();
|
radiusLengthSqr = (int) radiusSqr.getX();
|
||||||
this.sphere = radius.getY() == radius.getX() && radius.getX() == radius.getZ();
|
this.sphere = radius.getY() == radius.getX() && radius.getX() == radius.getZ();
|
||||||
inverseRadius = Vector3.ONE.divide(radius);
|
inverseRadiusSqr = Vector3.ONE.divide(radiusSqr);
|
||||||
//FAWE end
|
//FAWE end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,9 +249,9 @@ public class EllipsoidRegion extends AbstractRegion {
|
|||||||
if (sphere) {
|
if (sphere) {
|
||||||
return cx2 + cy2 + cz2 <= radiusLengthSqr;
|
return cx2 + cy2 + cz2 <= radiusLengthSqr;
|
||||||
}
|
}
|
||||||
double cxd = cx2 * inverseRadius.getX();
|
double cxd = cx2 * inverseRadiusSqr.getX();
|
||||||
double cyd = cy2 * inverseRadius.getY();
|
double cyd = cy2 * inverseRadiusSqr.getY();
|
||||||
double czd = cz2 * inverseRadius.getZ();
|
double czd = cz2 * inverseRadiusSqr.getZ();
|
||||||
return cxd + cyd + czd <= 1;
|
return cxd + cyd + czd <= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,8 +280,8 @@ public class EllipsoidRegion extends AbstractRegion {
|
|||||||
if (cz2 > radiusSqr.getBlockZ()) {
|
if (cz2 > radiusSqr.getBlockZ()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
double cxd = cx2 * inverseRadius.getX();
|
double cxd = cx2 * inverseRadiusSqr.getX();
|
||||||
double czd = cz2 * inverseRadius.getZ();
|
double czd = cz2 * inverseRadiusSqr.getZ();
|
||||||
return cxd + czd <= 1;
|
return cxd + czd <= 1;
|
||||||
}
|
}
|
||||||
//FAWE end
|
//FAWE end
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren