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​ ​ ...

Get OpenGL ES 2 for Android now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.