This commit is contained in:
33333-33333 2026-07-16 22:12:03 +09:00
commit 2cc2f003df
71 changed files with 3359 additions and 1027 deletions

View file

@ -4,14 +4,11 @@
// Shared primitive geometry helpers used by placement, collision, mechanical bodies,
// editor hit-testing, and world obstacle queries.
(function (global) {
function num(v, fallback = 0) {
const num = global.TarinaiCoreHelpers?.finiteOr || ((v, fallback = 0) => {
const n = Number(v);
return Number.isFinite(n) ? n : fallback;
}
function clampValue(v, min, max) {
return Math.max(min, Math.min(max, v));
}
});
const clampValue = global.TarinaiCoreHelpers?.clampNumber || ((v, min, max) => Math.max(min, Math.min(max, v)));
function orientedRectAabb(cx, cy, halfW, halfH, angle) {
const c = Math.cos(num(angle));