Closed capdevon closed 1 year ago
Thanks for documenting this issue.
I too have noticed this long ago, but I forgot and just never used worldSpace=true again.
I think the problem is more general and not only applies to certain emitter shapes: worldSpace=true always introduces interpolation which messes with particle spawn positions. It's only visible when particles don't spawn at the origin.
I've posted a description of the issue and a shorter test case here: https://hub.jmonkeyengine.org/t/particle-gravity-doesnt-rotate-with-parent-node/39731/5
If you agree, I propose to remove the code introduced with commit 6075e463. Tell me if I can create a new PR to do it.
@FennelFetish thank you for providing additional helpful information on the issue.
Removing that code would re-introduce the problem that motivated PR #381. Let's not do that, if possible.
ok I won't, what do you suggest we do?
Let's fix this bug without getting rid of interpolation.
I don't know how to do it, do you have any ideas?
Yes, but I'm busy with other tasks.
I could not figure out how to fix it for EmitterMeshVertexShape
while keeping interpolation on. Maybe we should add a new boolean flag "particleInterpolationEnabled" with the appropriate setter/getter in ParticleEmmiter so users can turn it off when using EmitterMeshVertexShape
or EmitterMeshFaceShape
shapes.
What do you guys think?
Adding a mode flag would break existing apps that don't assume the default mode. I still think this is fixable without breaking apps.
I still think this is fixable without breaking apps
Found a new solution to fix this issue. Will submit a PR with the details soon.
Submitted a fix in: https://github.com/jMonkeyEngine/jmonkeyengine/pull/1889
@stephengold can you please take a look at it?
will do
Fixed in https://github.com/jMonkeyEngine/jmonkeyengine/commit/36f9c895a28b9ff730bab55c252a4be5cdb2f2a2
@stephengold, thanks for reviewing!
Using the shape emitters (
EmitterMeshVertexShape
orEmitterMeshFaceShape
withworldSpace
= true), the particles are generated neither from the vertices nor from the faces of the 3d model, but in a position that seems to correspond to the position of theParticleEmitter
.The bug could have been introduced with the following commit 6075e463.
Here is the test case: