不放大的3连靶
This commit is contained in:
27
src/util.js
27
src/util.js
@@ -1,4 +1,3 @@
|
||||
import websocket from "@/websocket";
|
||||
import { isGamingAPI, getGameAPI } from "@/apis";
|
||||
|
||||
export const formatTimestamp = (timestamp) => {
|
||||
@@ -411,8 +410,8 @@ const calcNormalBowTarget = (x, y, diameter, arrowRadius) => {
|
||||
const arrowCenterY = y + arrowRadius;
|
||||
|
||||
// 计算靶心坐标(靶纸中心)
|
||||
const centerX = diameter / 2;
|
||||
const centerY = diameter / 2;
|
||||
const centerX = (diameter + arrowRadius * 2) / 2;
|
||||
const centerY = (diameter + arrowRadius * 2) / 2;
|
||||
|
||||
// 计算弓箭圆心到靶心的距离
|
||||
const deltaX = arrowCenterX - centerX;
|
||||
@@ -451,8 +450,8 @@ const calcHalfBowTarget = (x, y, diameter, arrowRadius, noX = false) => {
|
||||
const arrowCenterY = y + arrowRadius;
|
||||
|
||||
// 计算靶心坐标(靶纸中心)
|
||||
const centerX = diameter / 2;
|
||||
const centerY = diameter / 2;
|
||||
const centerX = (diameter + arrowRadius * 2) / 2;
|
||||
const centerY = (diameter + arrowRadius * 2) / 2;
|
||||
|
||||
// 计算弓箭圆心到靶心的距离
|
||||
const deltaX = arrowCenterX - centerX;
|
||||
@@ -484,11 +483,11 @@ export const calcTripleBowTarget = (
|
||||
arrowRadius,
|
||||
noX = false
|
||||
) => {
|
||||
const side = diameter * 0.31;
|
||||
const side = diameter * 0.327; // 115 / 351
|
||||
if (y / diameter >= 0.649) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.355,
|
||||
y - diameter * 0.693,
|
||||
x - diameter * 0.338,
|
||||
y - diameter * 0.675,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
@@ -496,17 +495,17 @@ export const calcTripleBowTarget = (
|
||||
}
|
||||
if (y / diameter >= 0.31) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.355,
|
||||
y - diameter * 0.356,
|
||||
x - diameter * 0.338,
|
||||
y - diameter * 0.337,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
);
|
||||
}
|
||||
if (y / diameter >= -0.025) {
|
||||
if (y / diameter >= -0.026) {
|
||||
return calcHalfBowTarget(
|
||||
x - diameter * 0.355,
|
||||
y - diameter * 0.018,
|
||||
x - diameter * 0.338,
|
||||
y - diameter * 0,
|
||||
side,
|
||||
arrowRadius,
|
||||
noX
|
||||
@@ -544,7 +543,7 @@ export const calcPinBowTarget = (x, y, diameter, arrowRadius, noX = false) => {
|
||||
return r1 || r2 || r3;
|
||||
};
|
||||
|
||||
export const calcRing = (bowtargetId, x, y, diameter, arrowRadius) => {
|
||||
export const calcRing = (bowtargetId, x, y, diameter, arrowRadius = 5) => {
|
||||
if (bowtargetId < 4) {
|
||||
return calcNormalBowTarget(x, y, diameter, arrowRadius);
|
||||
} else if (bowtargetId < 7) {
|
||||
|
||||
Reference in New Issue
Block a user