Files
NapCatQQ/.pnpm-store/v3/files/88/7c6a1ea2506ac4d1b70d7324389dbaff562c10e8d0264c51e7380e4780937975aae6a4a5bc1b5655b19252b7c7fe1bc6c3c7a2d6b8d0c8a918fef02c2e028e
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

10 lines
318 B
Plaintext

import { velocityPerSecond } from 'motion-utils';
const velocitySampleDuration = 5; // ms
function calcGeneratorVelocity(resolveValue, t, current) {
const prevT = Math.max(t - velocitySampleDuration, 0);
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
}
export { calcGeneratorVelocity };