diff options
author | Janne Karhu <jhkarh@gmail.com> | 2008-02-17 16:41:42 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2008-02-17 16:41:42 +0300 |
commit | 33b569106e113910f4c5a55c1ed3b690649e7ecd (patch) | |
tree | d958d90531462d2e0c11eb286dae94c70e61341f /source | |
parent | e83d8ea5864288f286251e1b7a328cfa72590741 (diff) |
Removed "roll" and "rotation" child particle kink modes as they couldn't be made to work properly. Will have to see later if these can be put back in so that they actually work.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 66 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 2 | ||||
-rw-r--r-- | source/blender/src/buttons_object.c | 4 |
3 files changed, 2 insertions, 70 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 8a09c1d67c1..47cd13cc79e 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1436,59 +1436,6 @@ static void do_prekink(ParticleKey *state, ParticleKey *par, float *par_rot, flo } } break; - //case PART_KINK_ROT: - // vec[axis]=1.0; - - // QuatMulVecf(par->rot,vec); - - // VecMulf(vec,amplitude*(float)sin(t)); - - // VECADD(state->co,state->co,vec); - // break; - } -} -static void do_postkink(ParticleKey *state, ParticleKey *par, float *par_rot, float time, float freq, float shape, float amplitude, short type, short axis, float obmat[][4]) -{ - static ParticleKey first; - static float q[4]; - float vec[3]={0.0,0.0,0.0}; - float t; - - CLAMP(time,0.0,1.0); - - t=time; - - t*=(float)M_PI*freq; - - if(par==0) return; - - switch(type){ - case PART_KINK_ROLL: - if(time<(0.5+shape/2.0f)){ - float *q2; - memcpy(&first,state,sizeof(ParticleKey)); - Normalize(first.vel); - if(par_rot) - q2=par_rot; - else - q2=vectoquat(par->vel,axis,(axis+1)%3); - QUATCOPY(q,q2); - } - else{ - float fac; - shape=0.5f+shape/2.0f; - t-=(float)M_PI*(shape*freq + 0.5f); - - vec[axis]=1.0; - - QuatMulVecf(q,vec); - - fac=amplitude*(1.0f+((1.0f-time)/(1.0f-shape)*(float)sin(t))); - VECADDFAC(state->co,first.co,vec,fac); - fac=amplitude*((1.0f-time)/(1.0f-shape)*(float)cos(t)); - VECADDFAC(state->co,state->co,first.vel,fac); - } - break; } } static void do_clump(ParticleKey *state, ParticleKey *par, float time, float clumpfac, float clumppow, float pa_clump) @@ -1601,7 +1548,6 @@ int do_guide(ParticleKey *state, int pa_num, float time, ListBase *lb) VECCOPY(key.co,pa_loc); do_prekink(&key, &par, 0, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, pd->kink, pd->kink_axis, 0); do_clump(&key, &par, guidetime, pd->clump_fac, pd->clump_pow, 1.0f); - do_postkink(&key, &par, 0, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, pd->kink, pd->kink_axis, 0); VECCOPY(pa_loc,key.co); VECADD(pa_loc,pa_loc,guidevec); @@ -2122,10 +2068,6 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, part->kink_freq * pa_kink, part->kink_shape, part->kink_amp, part->kink, part->kink_axis, ob->obmat); do_clump((ParticleKey*)state, (ParticleKey*)par, t, part->clumpfac, part->clumppow, pa_clump); - - if(part->kink) - do_postkink((ParticleKey*)state, (ParticleKey*)par, par->rot, t, - part->kink_freq * pa_kink, part->kink_shape, part->kink_amp, part->kink, part->kink_axis, ob->obmat); } if(part->flag & PART_BRANCHING && ctx->between == 0 && part->flag & PART_ANIM_BRANCHING) @@ -3565,10 +3507,6 @@ void psys_get_particle_on_path(Object *ob, ParticleSystem *psys, int p, Particle do_clump(state, par, t, part->clumpfac, part->clumppow, 1.0f); - if(part->kink) - do_postkink(state, par, par->rot, t, part->kink_freq * pa_kink, part->kink_shape, - part->kink_amp, part->kink, part->kink_axis, ob->obmat); - if(part->rough1 != 0.0) do_rough(orco, t, part->rough1, part->rough1_size, 0.0, state); @@ -3666,10 +3604,6 @@ int psys_get_particle_state(Object *ob, ParticleSystem *psys, int p, ParticleKey // // /* TODO: pa_clump vgroup */ // do_clump(state,key1,t,part->clumpfac,part->clumppow,0); - - // if(part->kink) /* TODO: part->kink_freq*pa_kink */ - // do_postkink(state,key1,t,part->kink_freq,part->kink_shape,part->kink_amp,part->kink,part->kink_axis,ob->obmat); - //} //else{ if (pa) { /* TODO PARTICLE - should this ever be NULL? - Campbell */ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 60ee5117570..3a326149ed4 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -292,8 +292,6 @@ typedef struct ParticleSystem{ #define PART_KINK_RADIAL 2 #define PART_KINK_WAVE 3 #define PART_KINK_BRAID 4 -#define PART_KINK_ROT 5 -#define PART_KINK_ROLL 6 /* part->draw */ #define PART_DRAW_VEL 1 diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index d136e19f61f..e6061a221c9 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -4034,14 +4034,14 @@ static void object_panel_particle_children(Object *ob) /* kink */ uiBlockBeginAlign(block); if(part->kink) { - uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw/2,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path"); + uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw/2,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path"); uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Axis %t|Z %x2|Y %x1|X %x0", butx+butw/2,buty,butw/2,buth, &part->kink_axis, 14.0, 0.0, 0, 0, "Which axis to use for offset"); uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Freq:", butx,(buty-=buth),butw,buth, &part->kink_freq, 0.0, 10.0, 1, 3, "The frequency of the offset (1/total length)"); uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->kink_shape, -0.999, 0.999, 1, 3, "Adjust the offset to the beginning/end"); uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Amplitude:", butx,(buty-=buth),butw,buth, &part->kink_amp, 0.0, 10.0, 1, 3, "The amplitude of the offset"); } else { - uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path"); + uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path"); buty-=3*buth; } uiBlockEndAlign(block); |