kienamtics

This commit is contained in:
PROFERIS - Mi³osz Stocki
2026-07-08 14:53:47 +02:00
parent ed6c6a6658
commit 242df22ba6
6 changed files with 109 additions and 2 deletions
+3 -2
View File
@@ -294,8 +294,9 @@ function armsCrossed(theta1, theta2) {
return false;
}
const cross1 = lineIntersectsBox(m1x, m1y, e1x, e1y, -BOX_HALF_W, BOX_HALF_W, BOX_Y_MIN, BOX_Y_MAX);
const cross2 = lineIntersectsBox(m2x, m2y, e2x, e2y, -BOX_HALF_W, BOX_HALF_W, BOX_Y_MIN, BOX_Y_MAX);
// Motors are at Y=0, so they are inside BOX_Y_MIN=-10. Start the collision box above the motors.
const cross1 = lineIntersectsBox(m1x, m1y, e1x, e1y, -BOX_HALF_W, BOX_HALF_W, 15, BOX_Y_MAX);
const cross2 = lineIntersectsBox(m2x, m2y, e2x, e2y, -BOX_HALF_W, BOX_HALF_W, 15, BOX_Y_MAX);
// Also check if elbows went rogue (e.g. wrapped entirely around the wrong side)
const e1_rogue = e1x > BOX_HALF_W && e1y < BOX_Y_MAX;