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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.