diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-21 15:59:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-21 15:59:47 +0400 |
commit | f7717b2e80907a974b472d0ee786f63b06efa40c (patch) | |
tree | 5119c2412e2cc902e83e3017adf51367529a6ffa /source/blender/blenkernel/intern/particle.c | |
parent | 6a5c03630423714b0a6c18e2c8b8c573c55602f7 (diff) |
option to use curve point weights to influence particle effectors.
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index c4888dedf48..e1b91b7cc5a 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1985,7 +1985,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time) float effect[3] = {0.0f, 0.0f, 0.0f}, veffect[3] = {0.0f, 0.0f, 0.0f}; float guidevec[4], guidedir[3], rot2[4], temp[3]; - float guidetime, radius, angle, totstrength = 0.0f; + float guidetime, radius, weight, angle, totstrength = 0.0f; float vec_to_point[3]; if(effectors) for(eff = effectors->first; eff; eff=eff->next) { @@ -2007,11 +2007,11 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time) cu = (Curve*)eff->ob->data; if(pd->flag & PFIELD_GUIDE_PATH_ADD) { - if(where_on_path(eff->ob, data->strength * guidetime, guidevec, guidedir, NULL, &radius)==0) + if(where_on_path(eff->ob, data->strength * guidetime, guidevec, guidedir, NULL, &radius, &weight)==0) return 0; } else { - if(where_on_path(eff->ob, guidetime, guidevec, guidedir, NULL, &radius)==0) + if(where_on_path(eff->ob, guidetime, guidevec, guidedir, NULL, &radius, &weight)==0) return 0; } @@ -2051,10 +2051,14 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time) VECCOPY(vec_to_point, key.co); VECADD(vec_to_point, vec_to_point, guidevec); + //VECSUB(pa_loc,pa_loc,pa_zero); VECADDFAC(effect, effect, vec_to_point, data->strength); VECADDFAC(veffect, veffect, guidedir, data->strength); totstrength += data->strength; + + if(pd->flag & PFIELD_GUIDE_PATH_WEIGHT) + totstrength *= weight; } if(totstrength != 0.0){ |