feat(match): 添加画面上下镜像、跳过准备和装甲板整局复位

This commit is contained in:
sloray committed 2026-10-31 09:27:26 +08:00
1 parent 235fb1c73b
commit 338efa5c2e
39 files changed
+1094 -54

No files matched your search

+4 -2
View File
@@ -58,7 +58,7 @@ export function computeLayout(
/**
* 瞄准点的屏幕位置。
*
* 图像坐标系里的 `(0.5 + offsetX, 0.5 + offsetY)` 再换到屏幕。镜像时横向要翻过来,
* 图像坐标系里的 `(0.5 + offsetX, 0.5 + offsetY)` 再换到屏幕。镜像时对应轴要翻过来,
* 否则准星会站在画面的另一边——偏移量是相对**摄像头光轴**定的,光轴在镜像之后换了位置。
*/
export function aimPoint(
@@ -67,15 +67,17 @@ export function aimPoint(
mirrored: boolean,
canvasWidth: number,
canvasHeight: number,
mirroredVertical = false,
): { x: number; y: number } {
if (!crosshair || geometry.drawWidth <= 0) {
return { x: canvasWidth / 2, y: canvasHeight / 2 };
}
const rawX = geometry.left + (0.5 + crosshair.offsetX) * geometry.drawWidth;
const rawY = geometry.top + (0.5 + crosshair.offsetY) * geometry.drawHeight;
return {
x: mirrored ? canvasWidth - rawX : rawX,
y: geometry.top + (0.5 + crosshair.offsetY) * geometry.drawHeight,
y: mirroredVertical ? canvasHeight - rawY : rawY,
};
}