Add a toggle for drawing collision lines
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user