简体   繁体   中英

libGDX ParticleEffect runtime velocity change

I have a flame ParticleEffect as the exhaust from a rocket. While the rocket moves slowly, the flame looks nice, but when the rocket starts moving very fast the flame can't really keep up because its particle speed is relative to the world and not the rocket. The result is blips that disappear from screen in parts of a second.

Can I update the emitter velocity during runtime, or can I set some kind of velocity point of reference to the particle effect (also during runtime)?

Thanks for any help!

It'd be a nice idea to encapsulate your particle effect inside an actor ( like here ).

Unfortunately the documentation is currently somewhat lacking, but you can always look at the source .

Now looking at that, the velocity value seems read only. So the answer to your question seems to be no.

But to fulfill your requirements, I'd suggest you to create 2 or 3 (or more) particle effects suitable for different velocities. (Much easy). Now you can change the entire effect during runtime.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM