This commit is contained in:
33333-33333 2026-06-28 23:07:40 +09:00
commit 0e432c62ae
87 changed files with 4282 additions and 3066 deletions

View file

@ -3,6 +3,8 @@
(function (global) {
function rectLocalPoint(rect, x, y) {
const shared = global.TarinaiCollisionFootprints?.rectLocalPoint;
if (typeof shared === "function") return shared(rect, x, y);
const dx = x - (rect.cx ?? 0);
const dy = y - (rect.cy ?? 0);
const c = Number.isFinite(rect.cos) ? rect.cos : Math.cos(rect.angle || 0);
@ -12,6 +14,8 @@
function rectWorldVector(rect, x, y) {
const shared = global.TarinaiCollisionFootprints?.rectWorldVector;
if (typeof shared === "function") return shared(rect, x, y);
const c = Number.isFinite(rect.cos) ? rect.cos : Math.cos(rect.angle || 0);
const ss = Number.isFinite(rect.sin) ? rect.sin : Math.sin(rect.angle || 0);
return { x: x * c - y * ss, y: x * ss + y * c };