There's an iphone app Fluid Toy which uses a particle system. The author released the source of the particles generator
http://www.nulldesign.de/wp-content/...icleSystem.zip but I can't use it because I don't know how to access his particles which are created as:-
Code:
particles = (SimpleParticle *) malloc(sizeof(SimpleParticle) * maxParticles);
The particle system is created
Code:
particles = [SimpleParticleSystem node];
[particles initialize: 1000 width: 20 height: 20];
But the code snippet shows accessing the individual particles
Code:
while(count < particles.particleCount)
{
p = &particleAr[count];
p->dir.x += CCRANDOM_MINUS1_1();
p->dir.y += CCRANDOM_MINUS1_1();
and I'm stuck understanding how
particleAr is defined. It's some sort of pointer to the memory containing the particles.
Any suggestions on how to get this working would be welcome.
It's a Cocos2d / 3D demo I'm working on and the built-in particles don't do exactly what I want.
Thanks in advance.