The complete code is here
I want to know why the particle and the particle emitter aren’t together.
You can see that in the video,emitter Stay where you are particle follow the character model
Although the final result is good to complete my idea .
But I didn’t understand,
I have also noticed this issue with Particle Monkey’s Emitter. I meant to make a post about it a while ago and forgot. In my case I have experienced the issue while using a regular Cone and Sphere EmitterShape.
I have never experienced the issue using jme’s stock ParticleEmitter with setInWorldSpace(true), but based on the issue report sgold linked, it sounds like that is because I never set an EmitterShape with with the stock ParticleEmitter and always just let it emit from a single point.
I made some version try I find version 1.0.2 and 1.0.3 setParticlesFollowEmitter is effective.
1.1.0 version setParticlesFollowEmitter Have no effect
I’m still comparing the content.
So, I finally have a few good test cases setup in my examples project. The mesh.getWorldTransform() is intended. It doesn’t work for you because you are transforming the emitter along with the model. This is a pretty common use case though so I’m looking at it as I go over the code for setParticlesFollowEmitter which looks like it is pretty broken. I think I’ve got translation ironed out at the moment, but I have some sort of rotation bug I need figure out before I push the fixes. Thanks for the help tracking this down. If you have any other issues let me know and I’ll check into them.
InWorldSpace=false is the Local Transform of the particle.
Particle monkey How do I Local Transform the particle?
Or how does the particle monkey Transform the two particles in the video.
Local Transform and World Transform.
emitter.setParticlesFollowEmitter(false);It doesn’t seem to work for me,
Just like you said
How do I change the WorldTransform and LocalTransform of a particle in the current situation?
I just pushed some changes yesterday that should work for you. Basically, if you added the emitter to the root node so it wasn’t moved then it would have worked, however, since you moved the emitter then it would basically apply the emitter transform as well as the mesh transform. This effectively doubled the transform. I reworked the code so emitter.setParticlesFollowEmitter(false); should work for you now if the emitter is moved. Give it a shot and let me know.
I add the emitter to the root node And set emitter.setParticlesFollowEmitter(false);
But it still didn’t work
As you can see from the video, the particles still don’t follow the model
Supplementary Content:
I found out that I didn’t get all of the files, so I re-ran “Git” and compiled it after getting all the code
It looks like it is doing exactly what it is supposed to. SetParticlesFollowEmitter when set to false means that once they are emitted they are in world space so moving the emitter won’t change the translation. I thought that was what you were trying to do.
I made a change to the EmitterMesh class that will switch if the emitter mesh gives you local or global positions for the particles that get emitted.
Side note, the debug mesh won’t be in the correct position. The code doesn’t currently sync the emitterShape location and only takes the location it was first turned on at.
This is the only problem I’m trying to do at the moment is that I can’t switch the particle InworldSpace to adjust whether the particle transition is in world or Local, like in the video.
I want to know how I can achieve the effect in the video in Particle Monkey.
So far the effect of “InworldSpace=true” in the video has been completed, how to complete the effect of “InworldSpace=false”?
Thank you for your recent help. Thank you very much @glh3586
I now add the emitter to the node of the model instead of the root node.
And use setEmitFromWorldSpace and setParticlesFollowEmitter to control the particle transform.
When I do these set in the code, it appears as in the video that the particle-wrapped mesh seems much larger.
As you can see from the video,The particle wrapped grid seems to be much larger than the emitter.
supplement:
The problem occurs when transform=flase.
It seems to be problem with mesh.getLocalTransform();.
But I’m still not sure why mesh.getLocalTransform(); particle wrapped mesh is much larger than the emitter.
I still can’t find further problems in the code and my current knowledge is not enough to allow me to understand the data design in the particle.
Supplement 2:
I was trying to make sense of it without a clue.
Until I suddenly had an idea .
I tried to change the emitter Transform
I found that everything worked (but not completely)
The emitter got smaller, the particles got smaller, but the particles wrapped around the model and did what I wanted them to do.
I still don’t understand how Particle Monkey controls the emitter mesh and the particle mesh , I can’t provide a valid code , I’m very sorry …
What is certain is emitterMesh. SetEmitFromWorldSpace (false); The emitter is not in sync with the model’s transform