Skip to content
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

Particle Emitter Rotation + Camera Position bug #4691

Closed
Formic opened this issue Aug 5, 2019 · 1 comment
Closed

Particle Emitter Rotation + Camera Position bug #4691

Formic opened this issue Aug 5, 2019 · 1 comment

Comments

@Formic
Copy link

Formic commented Aug 5, 2019

Version

  • Phaser Version: 3.18.0
  • Operating system: Windows 10

Description

When a particle emitter manager has a rotation set, and the camera has been moved, the particle emitter will orbit the origin (I think it's the origin anyway), as opposed to rotating in place.

Example Test Code

I quickly cobbled this together using a few examples from the labs. If the last line which changes the angle of the particles is commented out, the particles will emit from the correct position.

https://codepen.io/anon/pen/ZgvYmN

Additional Information

I pulled down the code and attempted to find a fix myself. I think there might be a systemic issue with the way a particle gets the position in the Fire (or FireAt, I forget what it is called exactly) method. By the time the ParticleManager renderers run, the emitter manager has no position, so when the matrix is built, only the rotation is used, and not the position, as the position is baked into the child's x,y.

I couldn't see a fix without divorcing the position of the systems internally, and only applying them in the render pipeline. I wasn't really sure if there was a more ideal way, so I figured it was time to just create a bug report and let someone with more domain knowledge tackle it.

I also wasn't sure if the setFollow should be removed from the emitter and to the emitter manager, or if that was just my own bias sneaking in.

Thanks for looking at this, and for making a great engine!

photonstorm added a commit that referenced this issue Sep 23, 2020
…x differently, splitting out the parent matrix and factoring in follow offsets separately. This fixes numerous issues with particle emitters being incorrectly offset when added to Containers. Fix #5319 #5195 #4739 #4691
@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants