hm
This commit is contained in:
parent
cefa2ace5a
commit
0e432c62ae
87 changed files with 4282 additions and 3066 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue