Originally Posted By: Rackscha
I just have Comercial

Yes I know, that is why I am telling you this wink


Originally Posted By: Rackscha
And where should i pass NULL? in effect()? And how do i access the first created particle?(to get the linklist start)

I meant the particle event, like this:

Code:
VECTOR vecCreate;

// create particle
effect(initPhysxParticle, 1, &vecCreate, NULL);

//...

void initPhysxParticle (PARTICLE* p)
{
    // initialize
   
   p->lifespan = 100; // big lifespan
   p->event = NULL;
}




Getting the first particle is a bit tricky, because you need a particle instance for ptr_first. I see two ways: 1.) create a dummy particle that is alive all the time and writes it's pointer into a global one, this can be used with ptr_first:

Code:
PARTICLE* g_partInstance = NULL;

level_load("myLevel.wmb");

g_partInstance = NULL;
effect(initParticleReference, 1, nullvector, NULL);

//...

void initParticleReference (PARTICLE* p)
{
   p->lifespan = 100;
   p->event = evParticleReference;
}

void evParticleReference (PARTICLE* p)
{
    p->lifespan = 100;
    g_partInstance->p;
}



or 2.) you give the very first PhysX-particle an event that overwrite that pointer. If the particle is destroyed, you have to reset a flag or so to indicate, that you give the next PhysX-particle the function again.

Nevertheless, you have to indicate the PhysX-particle somehow, because it might be the case, that there are other particles as well, which don't belong to the fluid. I would set each's Physx-particle's skill1 or so to an identifier reserved for PhysX particles. In the loop, in which you update the particles, you check against this skill, and if and only if it matches the ID, you update it.