优化碰撞识别,加入暖场帧数

This commit is contained in:
tianmo committed 2026-10-29 17:20:05 +08:00
1 parent b8652acce0
commit fed1015849
21 files changed
+195 -23

No files matched your search

+6
View File
@@ -862,4 +862,10 @@ export class ParticleEmitter extends Container {
this._lastSeed = this.cfg.seed
this.rng = mulberry32(this.cfg.seed >>> 0)
}
/** 从当前重置状态向前模拟,用于时间轴第 0 帧的暖场。 */
warmup(frames: number, frameDuration: number) {
const count = Math.max(0, Math.floor(Number(frames) || 0))
for (let frame = 0; frame < count; frame++) this.update(frameDuration)
}
}