-
Notifications
You must be signed in to change notification settings - Fork 23
refactor: particle track time synchronization logic #1381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/2.9
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes refactor the particle system simulation architecture by introducing a new public Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@packages/effects-core/src/plugins/particle/particle-system.ts`:
- Around line 349-358: The simulate method sets this.frozen unconditionally even
when update early-returns because the system hasn’t started; change simulate in
the ParticleSystem class so it only sets this.frozen when a simulation actually
ran (e.g., check this.started before calling update and return early, or have
update return a success boolean and set this.frozen only when that is true),
referencing the simulate, update and started/frozen members and keeping onUpdate
behavior unchanged.
In `@packages/effects-core/src/plugins/particle/particle-vfx-item.ts`:
- Around line 35-37: After resetting the particle system in the time-seek branch
(where you call particleSystem.reset()), ensure the system is re-enabled for
simulation by also calling particleSystem.startEmit() so the internal started
flag is set and subsequent particleSystem.simulate() calls will advance; update
the logic around the reset in particle-vfx-item.ts to call startEmit() after
reset (but only when you intend to resume emitting) to avoid leaving
started=false after a seek-back.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.