stable
This commit is contained in:
parent
fbdac9ebf1
commit
86226ccc94
97 changed files with 5790 additions and 2307 deletions
|
|
@ -84,6 +84,15 @@
|
|||
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);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue