From 5d02620b554e5a71e67f06d75e99951a388a0b95 Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Sat, 20 Dec 2025 12:58:57 -0800 Subject: [PATCH] Add a toggle for drawing collision lines --- html/images/space.svg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/html/images/space.svg b/html/images/space.svg index 4c418bf..9c0ca19 100644 --- a/html/images/space.svg +++ b/html/images/space.svg @@ -168,6 +168,7 @@ const triangleContainer = document.querySelector('#triangles'); const lineContainer = document.querySelector('#lines'); const trianglePts = points.map((pt, i) => [pt, points[(i + 1) % points.length]]); + const drawCollisionLines = false; function drawEdges(lpts) { let edges = lpts.map(e => e.join(' ')); @@ -238,9 +239,11 @@ t.setAttribute('points', attr.join(delim)); } - t.classList[isClockwise && isAcute ? "add" : "remove"](className); - t.classList[isClockwise && !isAcute ? "add" : "remove"]("obtuse"); - t.classList[!isClockwise ? "add" : "remove"]("anti-clockwise"); + if (drawCollisionLines) { + t.classList[isClockwise && isAcute ? "add" : "remove"](className); + t.classList[isClockwise && !isAcute ? "add" : "remove"]("obtuse"); + t.classList[!isClockwise ? "add" : "remove"]("anti-clockwise"); + } if (isClockwise && isAcute) visible.push(t); }); @@ -397,7 +400,6 @@ return position; } - let start; let restart = false; function firstFrame(timestamp) {