Particle charge effector wasn't working properly.

* Probably just forgot this code somewhere a long time ago.
This commit is contained in:
Janne Karhu
2011-03-24 12:12:54 +00:00
parent 7735eccc54
commit c2ee06a4b2

View File

@@ -361,12 +361,18 @@ void pdEndEffectors(ListBase **effectors)
void pd_point_from_particle(ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, EffectedPoint *point)
{
ParticleSettings *part = sim->psys->part;
point->loc = state->co;
point->vel = state->vel;
point->index = pa - sim->psys->particles;
point->size = pa->size;
/* TODO: point->charge */
point->charge = 1.0f;
point->charge = 0.0f;
if(part->pd && part->pd->forcefield == PFIELD_CHARGE)
point->charge += part->pd->f_strength;
if(part->pd2 && part->pd2->forcefield == PFIELD_CHARGE)
point->charge += part->pd2->f_strength;
point->vel_to_sec = 1.0f;
point->vel_to_frame = psys_get_timestep(sim);