pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
796 stars 125 forks source link

Apply force #127

Closed spassvogel closed 4 years ago

spassvogel commented 4 years ago

Hi ,great work on the library. I had a question, would it be possible to apply a (variable) amount of force to an emitter? Let's say you have a smoke system that is affected by wind forces?

This illustrates it quite nicely: https://processing.org/examples/smokeparticlesystem.html

andrewstart commented 4 years ago

Emitters/particles have an acceleration property that is basically that, although it is not a shared global reference, so currently you wouldn't be able to change the acceleration on the Emitter and have all live Particles start using it immediately.

spassvogel commented 4 years ago

Ah I can't believe I didn't see that. Thanks!

Well I tried to assign the result of a sin function with some added randomness to the acceleration at requestAnimationFrame and it gave a nice effect but it really killed performance. Ah well ¯_(ツ)_/¯