So I have a few unusual questions about particle emitters. The first one would be how to emit particles that arent billboards and always face the player, so I could make something like this:
What I have done so far is get the emitter to at least get to the right positions for the particles like this every frame (while the emitter is set to InWorldSpace):
emitter.setLocalTranslation(FastMath.rand.nextFloat()*1000-500, FastMath.rand.nextFloat()*1000-500, FastMath.rand.nextFloat()*2000);
Which seems to me like an unnecessary and dumb way to do it, but it seems that there is no way to set a single particle’s location at all, is there?
Now the other problem is that the particles are all square and I cant seem to find a way to get them elongated. I could of course spawn Box geometries with large depth values and write my own custom emitter but then what’s the point of the official one.
The next question is how to stop an emitter from emitting without disabling the system itself. (unrelated to the first question I need it for engine exausts).
setEnabled(false) is out of the question since it freezes the particles and I’d like the remaining ones to continue travelling.
This also disqualifies detaching the emitter since they arent supposed to suddently vanish either.
The remaining obvious option is setParticlesPerSec(0f) which doesn’t do anything at all if used with common sense. What kinda works for me is this:
Setting up the emitter so the beginning PerSec value is zero:
And then doing this every frame:
Not sure how I arrived at this weird setup but it seems to work. The problem is that its very framerate unreliable. One spike and the emitter decides to throw out particles until the fps stabilises again. This is kind of the exact opposite is what should the code be if the emitters behaved correctly but I cant seem to get it working.
EDIT: Disregard everything in italic, it seems that I had some forgotten code that was messing stuff up. Starting the particle emitter with setParticlesPerSec(0f) and then to the emitting value and back seems to be working correctly now.
The first question still remains.