压线精度调整
This commit is contained in:
70
src/util.js
70
src/util.js
@@ -472,7 +472,7 @@ const calcHalfBowTarget = (x, y, diameter, arrowRadius, noX = false) => {
|
||||
if (relativeDistance <= 0.4) return 9;
|
||||
if (relativeDistance <= 0.6) return 8;
|
||||
if (relativeDistance <= 0.8) return 7;
|
||||
if (relativeDistance <= 0.992) return 6;
|
||||
if (relativeDistance <= 1) return 6;
|
||||
|
||||
return 0; // 脱靶
|
||||
};
|
||||
@@ -484,60 +484,58 @@ export const calcTripleBowTarget = (
|
||||
arrowRadius,
|
||||
noX = false
|
||||
) => {
|
||||
const side = diameter * 0.324;
|
||||
if (x / diameter >= 0.316) {
|
||||
if (y / diameter >= 0.654) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.342,
|
||||
y - diameter * 0.68,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
if (y / diameter >= 0.313) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.342,
|
||||
y - diameter * 0.34,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
if (y / diameter >= -0.023) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.342,
|
||||
y - diameter * 0.005,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
const side = diameter * 0.31;
|
||||
if (y / diameter >= 0.649) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.355,
|
||||
y - diameter * 0.693,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
if (y / diameter >= 0.31) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.355,
|
||||
y - diameter * 0.356,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
if (y / diameter >= -0.025) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.355,
|
||||
y - diameter * 0.018,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
export const calcPinBowTarget = (x, y, diameter, arrowRadius, noX = false) => {
|
||||
const side = diameter * 0.484;
|
||||
const side = diameter * 0.482;
|
||||
let r1 = 0;
|
||||
let r2 = 0;
|
||||
let r3 = 0;
|
||||
if (x / diameter >= 0.23 && y / diameter >= 0.005) {
|
||||
r1 = calcHalfBowTarget(
|
||||
x - diameter * 0.26,
|
||||
y - diameter * 0.0345,
|
||||
y - diameter * 0.034,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
if (x / diameter >= -0.03 && y / diameter >= 0.456) {
|
||||
r2 = calcHalfBowTarget(x, y - diameter * 0.486, side, arrowRadius, noX);
|
||||
r2 = calcHalfBowTarget(x, y - diameter * 0.484, side, arrowRadius, noX);
|
||||
}
|
||||
if (x / diameter >= 0.49 && y / diameter >= 0.456) {
|
||||
r3 = calcHalfBowTarget(
|
||||
x - diameter * 0.52,
|
||||
y - diameter * 0.49,
|
||||
y - diameter * 0.485,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
@@ -546,11 +544,11 @@ export const calcPinBowTarget = (x, y, diameter, arrowRadius, noX = false) => {
|
||||
return r1 || r2 || r3;
|
||||
};
|
||||
|
||||
export const calcRing = (bowtargetId, x, y, diameter, arrowRadius = 5) => {
|
||||
export const calcRing = (bowtargetId, x, y, diameter, arrowRadius) => {
|
||||
if (bowtargetId < 4) {
|
||||
return calcNormalBowTarget(x, y, diameter, arrowRadius);
|
||||
} else if (bowtargetId < 7) {
|
||||
return calcHalfBowTarget(x, y, diameter + 2, arrowRadius);
|
||||
return calcHalfBowTarget(x, y, diameter, arrowRadius);
|
||||
} else if (bowtargetId === 7) {
|
||||
return calcTripleBowTarget(x, y, diameter, arrowRadius);
|
||||
} else if (bowtargetId === 8) {
|
||||
|
||||
Reference in New Issue
Block a user