plattysoft / Leonids

A Particle System for standard Android UI: http://plattysoft.github.io/Leonids/
Apache License 2.0
2.28k stars 398 forks source link

Add ability to add a custom initializer. #76

Closed yperess closed 7 years ago

yperess commented 7 years ago

This is needed in cases where a particle system's initializer needs to be updated on the fly (such as from a sensor listener). Prior to this a new ParticleSystem would have to be created or extra initializers would have to be added. Since the extra initializers simply override the previous initialization, they bloat memory.

Fixes #75

yperess commented 7 years ago

Ping

Is this library still maintained? I see the last update in Nov and a few pending pull requests.

plattysoft commented 7 years ago

Yes, it is sort of maintained, but it is also considered done.

I saw this, and I haven't replied or merged because there was a reason to not do it that way, but I couldn't remember it from the top of my head and I haven't had time to go through it.

yperess commented 7 years ago

Ah, sorry, just wanted to make sure someone was looking on the other end.

If it helps, my use case is an AR application that shows bubbles coming from the direction of an off screen object. As you move the phone I need to update the position and direction of the bubbles at the sensor rate. After the UI running for 30+ seconds the app gets really slow.

plattysoft commented 7 years ago

No problem.

If you are doing AR, you probably want to have a particle system in OpenGL, this library is designed for apps with standard views and it is not high performance (you can't really get that without going to OpenGL) it is meant to allow developers to have particles without putting an OpenGL engine, but you are probably already using that.

So, for AR, I'll recommend a 3D engine written on OpenGL and use the concepts of this library to have your own Particles. You also can make use of the 3D to have particles in space, not just in 2D.

Take a look at this other project, it may be useful to you: https://github.com/plattysoft/ArToolKitJpctBaseLib

yperess commented 7 years ago

Thanks, the app is very lightweight and for now is using simple views that are "locked" in place using the sensors. We're not yet using OpenGL but I'll keep that library in mind for when the project requires it.