Fix EPC end box collision and bounds to match 90° rotation
Rotate the direction vector -90° for the right box in collision detection and bounds calculation to match the perpendicular rendering orientation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a4884b4e9b
commit
e4c67b165b
@ -401,9 +401,10 @@ function getEpcCollisionQuads(
|
||||
// Right box quad
|
||||
const last = waypoints[waypoints.length - 1];
|
||||
const prev = waypoints[waypoints.length - 2];
|
||||
const rbDx = last.x - prev.x, rbDy = last.y - prev.y;
|
||||
const rbQ = boxQuad(
|
||||
ox + last.x, oy + last.y,
|
||||
last.x - prev.x, last.y - prev.y,
|
||||
rbDy, -rbDx, // rotated -90° to match perpendicular end box
|
||||
EPC_CONFIG.rightBox.w, EPC_CONFIG.rightBox.h,
|
||||
'right'
|
||||
);
|
||||
|
||||
@ -360,8 +360,8 @@ function recalcEpcBounds(sym: typeof layout.symbols[0]) {
|
||||
// Right box corners (oriented along last segment)
|
||||
const last = wps[wps.length - 1];
|
||||
const prev = wps[wps.length - 2];
|
||||
const rbDir = { x: last.x - prev.x, y: last.y - prev.y };
|
||||
const rbCorners = orientedBoxCorners(last.x, last.y, rbDir.x, rbDir.y, EPC_CONFIG.rightBox.w, EPC_CONFIG.rightBox.h, 'right');
|
||||
const rbDx = last.x - prev.x, rbDy = last.y - prev.y;
|
||||
const rbCorners = orientedBoxCorners(last.x, last.y, rbDy, -rbDx, EPC_CONFIG.rightBox.w, EPC_CONFIG.rightBox.h, 'right');
|
||||
for (const [bx, by] of rbCorners) {
|
||||
minX = Math.min(minX, bx); minY = Math.min(minY, by);
|
||||
maxX = Math.max(maxX, bx); maxY = Math.max(maxY, by);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user