O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

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

Adding the Particle System

Now we can start creating the particle system. Let’s create a new class called ParticleSystem inside the package com.particles.android.objects, starting off with the following code in the class:

Particles/src/com/particles/android/objects/ParticleSystem.java
 
private​ ​static​ ​final​ ​int​ POSITION_COMPONENT_COUNT = 3;
 
private​ ​static​ ​final​ ​int​ COLOR_COMPONENT_COUNT = 3;
 
private​ ​static​ ​final​ ​int​ VECTOR_COMPONENT_COUNT = 3;
 
private​ ​static​ ​final​ ​int​ PARTICLE_START_TIME_COMPONENT_COUNT = 1;
 
 
private​ ​static​ ​final​ ​int​ TOTAL_COMPONENT_COUNT =
 
POSITION_COMPONENT_COUNT
 
+ COLOR_COMPONENT_COUNT
 
+ VECTOR_COMPONENT_COUNT
 
+ PARTICLE_START_TIME_COMPONENT_COUNT;
 
 
private​ ​static​ ​ ...

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