This commit is contained in:
33333-33333 2026-06-26 19:04:32 +09:00
commit 077d4ab9ac
71 changed files with 2905 additions and 1063 deletions

View file

@ -10,6 +10,7 @@
return { x: dx * c + dy * ss, y: -dx * ss + dy * c };
}
function rectWorldVector(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);
@ -84,16 +85,16 @@
obj.vy = (obj.vy || 0) + ny * add;
}
}
if (rect.rotator) {
const omega = clamp(Number(rect.angularVelocity || 0) || 0, -8, 8);
const rx = obj.x - (rect.centerX ?? rect.item?.x ?? rect.cx ?? 0);
const ry = obj.y - (rect.centerY ?? rect.item?.y ?? rect.cy ?? 0);
const tvx = -ry * omega;
const tvy = rx * omega;
obj.vx = clamp((obj.vx || 0) + tvx * 0.28 + nx * 20, -900, 900);
obj.vy = clamp((obj.vy || 0) + tvy * 0.28 + ny * 20, -900, 900);
}
if (Number.isFinite(obj.spinVelocity)) obj.spinVelocity = clamp((obj.spinVelocity || 0) + (nx >= 0 ? -1 : 1) * 7.0, -46, 46);
if (rect.mechanical) {
global.TarinaiMechanicalSystem?.applySurfaceVelocityToCircle?.(obj, rect, nx, ny, vx, vy, {
damping: 1,
surfaceScale: rect.rotator ? 0.28 : 0.30,
normalBoost: rect.rotator ? 20 : 14,
maxSpeed: 900,
passiveImpulseScale: 1.0,
spinKick: 7.0,
});
} else if (Number.isFinite(obj.spinVelocity)) obj.spinVelocity = clamp((obj.spinVelocity || 0) + (nx >= 0 ? -1 : 1) * 7.0, -46, 46);
return true;
}