diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-03-24 15:12:54 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-03-24 15:12:54 +0300 |
commit | c2ee06a4b2bf5618930d38b646c82ae91abb4b65 (patch) | |
tree | 62964348ad8eaaf4bf43bb1c121dcab8764333e4 | |
parent | 7735eccc54970262696f9603f6a88ce6d77eee50 (diff) |
Particle charge effector wasn't working properly.
* Probably just forgot this code somewhere a long time ago.
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index f07dd0bc5f4..216dffc1e4a 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -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); |