removed unused processesseessess
This commit is contained in:
parent
348f355eb2
commit
4fdc567e08
158 changed files with 1317 additions and 3351 deletions
|
|
@ -18,14 +18,14 @@
|
|||
if (item.y < p) { item.y = p; item.vy = Math.abs(item.vy || 0) * 0.72; item.spinVelocity *= -0.72; }
|
||||
if (item.y > worldRef.h - p) { item.y = worldRef.h - p; item.vy = -Math.abs(item.vy || 0) * 0.72; item.spinVelocity *= -0.72; }
|
||||
resolveObstacleCollisions(item, dt, worldRef);
|
||||
global.TarinaiItemDynamicPinSystem?.tryBallPickup?.(item, worldRef);
|
||||
global.TarinaiItemDynamicPinSystem.tryBallPickup(item, worldRef);
|
||||
item.x = clamp(item.x, p, worldRef.w - p);
|
||||
item.y = clamp(item.y, p, worldRef.h - p);
|
||||
const groundFriction = Math.pow(0.72, dt);
|
||||
item.vx *= groundFriction;
|
||||
item.vy *= groundFriction;
|
||||
}
|
||||
global.TarinaiItemDynamicPinSystem?.tryBallPickup?.(item, worldRef);
|
||||
global.TarinaiItemDynamicPinSystem.tryBallPickup(item, worldRef);
|
||||
item.spin = (item.spin || 0) + (item.spinVelocity || 0) * dt + (item.vx || 0) * dt / Math.max(8, item.r || 18);
|
||||
item.spinVelocity *= Math.pow(0.65, dt);
|
||||
if (Math.hypot(item.vx || 0, item.vy || 0) < 0.18) { item.vx = 0; item.vy = 0; }
|
||||
|
|
@ -42,8 +42,8 @@
|
|||
// \u4e2d\u5fc3\u3067\u306f\u306a\u304f\u5916\u63a5\u534a\u5f84\u3067\u8ffd\u52a0\u8d70\u67fb\u3057\u3066\u3001\u9577\u3044\u68d2\u30fb\u5f80\u5fa9\u5e45\u306b\u3082\u885d\u7a81\u3055\u305b\u308b\u3002
|
||||
if (Array.isArray(worldRef.items)) {
|
||||
for (const it of worldRef.items) {
|
||||
if (!it || it.dead || it === item || !global.TarinaiMechanicalSystem?.isMechanicalType?.(it.type) || seen.has(it)) continue;
|
||||
const reach = global.TarinaiMechanicalSystem?.reach?.(it) || worldRef.rotatorExtent?.(it) || Math.max(64, it.r || 64);
|
||||
if (!it || it.dead || it === item || !global.TarinaiMechanicalSystem.isMechanicalType(it.type) || seen.has(it)) continue;
|
||||
const reach = global.TarinaiMechanicalSystem.reach(it) || worldRef.rotatorExtent?.(it) || Math.max(64, it.r || 64);
|
||||
if (distXY(item.x, item.y, it.x, it.y) <= searchRadius + reach + 36) {
|
||||
items.push(it);
|
||||
seen.add(it);
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
const restitution = Number.isFinite(rect.restitution) ? rect.restitution : 0.78;
|
||||
const velocityDamp = rect.bounce ? 1.0 : 0.94;
|
||||
const minBounceSpeed = Math.max(0, Number(rect.minBounceSpeed || 0) || 0);
|
||||
if (rect.oriented && global.TarinaiPhysics?.bounceCircleOffRect) {
|
||||
if (rect.oriented && global.TarinaiPhysics.bounceCircleOffRect) {
|
||||
const bounced = global.TarinaiPhysics.bounceCircleOffRect(item, rect, hitRadius, restitution, worldRef, { minBounceSpeed });
|
||||
if (!bounced) return;
|
||||
item.vx *= velocityDamp;
|
||||
|
|
@ -243,9 +243,5 @@
|
|||
global.TarinaiItemDynamicBallSystem = Object.freeze({
|
||||
update,
|
||||
resolveObstacleCollisions,
|
||||
applyHayDrag,
|
||||
resolveCircleBounce,
|
||||
resolveRectBounce,
|
||||
emitBounce,
|
||||
});
|
||||
})(typeof window !== "undefined" ? window : globalThis);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue