Fixed for forcefield. It needed to add half of the acceleration as speed on each frame it affected.

Cleaned the GUI for effectors: Widen the panel and the buttons. Made the button text more conformed.
Added vortex field for particles.  Particles swirl around z-axis of the object. Little hackish, could be made better.
This commit is contained in:
2004-07-09 14:39:06 +00:00
parent 7ba95846ca
commit c2a5da5cf7
2 changed files with 85 additions and 13 deletions

View File

@@ -1251,7 +1251,7 @@ static void editing_panel_deflectors(Object *ob)
uiBlock *block;
block= uiNewBlock(&curarea->uiblocks, "editing_panel_deflectors", UI_EMBOSS, UI_HELV, curarea->win);
if(uiNewPanel(curarea, block, "Particle Interaction", "Effects", 0, 0, 190, 204)==0) return;
if(uiNewPanel(curarea, block, "Particle Interaction", "Effects", 0, 0, 300, 204)==0) return;
/* should become button, option? */
if(ob->pd==NULL) {
@@ -1261,16 +1261,18 @@ static void editing_panel_deflectors(Object *ob)
if(ob->pd) {
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|0, B_DIFF, "Force field", 10,160,150,20, &ob->pd->forcefield, 0, 0, 0, 0, "Object center attracts or repels particles");
uiDefButF(block, NUM, B_DIFF, "Strength", 10,140,150,20, &ob->pd->f_strength, -100, 100, 100, 0, "Strength of force field");
uiDefButF(block, NUM, B_DIFF, "Fall-off", 10,120,150,20, &ob->pd->f_power, 0, 10, 100, 0, "Falloff power (real gravitational fallof = 2)");
uiDefButS(block, TOG|BIT|0, B_DIFF, "Force field", 10,160,200,20, &ob->pd->forcefield, 0, 0, 0, 0, "Object center attracts or repels particles");
uiDefButS(block, TOG|BIT|1, B_DIFF, "Vortex field", 10,140,200,20, &ob->pd->forcefield, 0, 0, 0, 0, "Particles swirl around Z-axis of the object");
uiDefButF(block, NUM, B_DIFF, "Strength: ", 10,120,200,20, &ob->pd->f_strength, -100, 1000, 1000, 0, "Strength of force field");
uiDefButF(block, NUM, B_DIFF, "Fall-off: ", 10,100,200,20, &ob->pd->f_power, 0, 10, 100, 0, "Falloff power (real gravitational fallof = 2)");
/* only meshes collide now */
if(ob->type==OB_MESH) {
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|0, B_DIFF, "Deflection",10,80,150,20, &ob->pd->deflect, 0, 0, 0, 0, "Deflects particles based on collision");
uiDefButF(block, NUM, B_DIFF, "Surface damping", 10,60,150,20, &ob->pd->pdef_damp, 0.0, 1.0, 10, 0, "Amount of damping during particle collision");
uiDefButF(block, NUM, B_DIFF, "Random damping", 10,40,150,20, &ob->pd->pdef_rdamp, 0.0, 1.0, 10, 0, "Random variation of damping");
uiDefButF(block, NUM, B_DIFF, "Permeability", 10,30,150,20, &ob->pd->pdef_perm, 0.0, 1.0, 10, 0, "Chance that the particle will pass through the mesh");
uiDefButS(block, TOG|BIT|0, B_DIFF, "Deflection",10,70,200,20, &ob->pd->deflect, 0, 0, 0, 0, "Deflects particles based on collision");
uiDefButF(block, NUM, B_DIFF, "Damping: ", 10,50,200,20, &ob->pd->pdef_damp, 0.0, 1.0, 10, 0, "Amount of damping during particle collision");
uiDefButF(block, NUM, B_DIFF, "Rnd Damping: ", 10,30,200,20, &ob->pd->pdef_rdamp, 0.0, 1.0, 10, 0, "Random variation of damping");
uiDefButF(block, NUM, B_DIFF, "Permeability: ", 10,10,200,20, &ob->pd->pdef_perm, 0.0, 1.0, 10, 0, "Chance that the particle will pass through the mesh");
}
}
}