private float [ ] generateParticleTimeStamps ( float totalTime ) { float timeStamps [ ] = new float [ mEmitRate * 2 ] ; if ( burstMode ) { for ( int i = 0 ; i < mEmitRate * 2 ; i += 2 ) { timeStamps [ i ] = totalTime ; timeStamps [ i + 1 ] = 0 ; } } else { for ( int i = 0 ; i < mEmitRate * 2 ; i += 2 ) { timeStamps [ i ] = totalTime + mRandom . nextFloat ( ) ; timeStamps [ i + 1 ] = 0 ; } } return timeStamps ; }
Generate random time stamps from the current time upto the next one second . Passed as texture coordinates to the vertex shader ; an unused field is present with every pair passed .