Posted By: Rackscha
Setting a particles position directly? - 01/13/13 18:56
Hi,
currently i need to set a particles position directly.
For this purpose, i save all particles in a list to access them.
(these particles are never deleted)
the global vars:
the particle function to initialize itself
this should store the particles BUT when i loop through the registered range(0 to FirstPIndex-1) to manipulate the positions, nothing happens to them :|
Someone has an idea?
currently i need to set a particles position directly.
For this purpose, i save all particles in a list to access them.
(these particles are never deleted)
the global vars:
Code:
PARTICLE** PList; int FirstPIndex = 0;
the particle function to initialize itself
Code:
function PInit(PARTICLE* p) { PList[FirstPIndex] = p; FirstPIndex++; p.size = 16; p.lifespan = 100; set(p, MOVE | BRIGHT | TRANSLUCENT); }
this should store the particles BUT when i loop through the registered range(0 to FirstPIndex-1) to manipulate the positions, nothing happens to them :|
Code:
for(i = 0; i < FirstPIndex; i++) { (PList[FirstPIndex]).x = 0; (PList[FirstPIndex]).y = 300; (PList[FirstPIndex]).z = 0; }
Someone has an idea?