This commit is contained in:
33333-33333 2026-07-17 12:25:23 +09:00
commit 61718e2981
18 changed files with 572 additions and 190 deletions

View file

@ -2016,6 +2016,15 @@ const vm = require('vm');
const context = {{
console, globalThis: null, window: null,
clamp: (v, lo, hi) => Math.max(lo, Math.min(hi, Number(v) || 0)),
TarinaiGeometry: {{
pointSegmentDistance(px, py, ax, ay, bx, by) {{
const sx = bx - ax, sy = by - ay;
const len2 = sx * sx + sy * sy;
if (len2 <= 1e-12) return Math.hypot(px - ax, py - ay);
const t = Math.max(0, Math.min(1, ((px - ax) * sx + (py - ay) * sy) / len2));
return Math.hypot(px - (ax + sx * t), py - (ay + sy * t));
}},
}},
audio: {{ damage() {{}}, play() {{}}, death() {{}} }},
}};
context.globalThis = context;