O'Reilly logo

Mastering Android NDK by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the particle system

To make our game look shinier, we add yet another component to our rendering engine: a particle system. Particles move similarly to boids from the previous chapter, but vastly outnumber them and are not supposed to participate in complex interactions. Since individual particles are transparent, we need to take care of the rendering order and render particles after all solid objects within the frame have been rendered.

Each particle is treated as a point-like object when speaking of dynamics and rendered as a screen-aligned quadrilateral. A single particle does not exist forever and its initial lifetime FLifeTime and current time-to-live FTTL are stored. The sParticle structure contains FPosition, FVelocity, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required