diff options
author | Jens Ole Wund <bjornmose@gmx.net> | 2005-08-16 21:48:47 +0400 |
---|---|---|
committer | Jens Ole Wund <bjornmose@gmx.net> | 2005-08-16 21:48:47 +0400 |
commit | 43e329edb72219b32979a0f73153a92f54d61607 (patch) | |
tree | 1f6a18c2a20d09e8682c1b30c864c4a4141a6e5b /source/blender | |
parent | 7c539f8ebc8ce5d4bd10c399c69daeeb04e93669 (diff) |
softbody <--> softbody collision
make softbodies collide with objects patented to armatures (bones), lattices .. )
Softbody deflectors always use the new modifier stack. (thanks ZR)
Softbody deflector code checks for identity of colliding objects so,
there is no need to prohibit softbodies to be a deflector.
So now you can put some soft balls in a box and see them bounce.
see : http://wund.privat.t-online.de/bt/sb_sb_coll.blend
A deflector cube parented to SB lattice:
http://wund.privat.t-online.de/bt/sb_lattice.blend
BM
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 4 | ||||
-rw-r--r-- | source/blender/src/buttons_object.c | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 8a58fe88a85..1c2365902f5 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -1443,7 +1443,9 @@ int SoftBodyDetectCollision(float opco[3], float npco[3], float colco[3], fa *= fa; fa = 1.0f/fa; copyob = ob; - if (ob->pd->flag & PDEFLE_DEFORM){// get colliding mesh from modifier stack +// if (ob->pd->flag & PDEFLE_DEFORM){// get colliding mesh from modifier stack +// keep this option for debugging but IMHO this is not needed + if (1){// get colliding mesh from modifier stack if(1) { // so maybe someone wants overkill to collide with subsurfed dm = mesh_get_derived_deform(copyob, &dmNeedsFree); diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 820e3ba4b04..04e8b16c6bc 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -1453,7 +1453,9 @@ int modifiers_isSoftbodyEnabled(Object *ob) ModifierData *md = modifiers_findByType(ob, eModifierType_Softbody); /* Softbody not allowed in this situation, enforce! */ - if (md && ob->pd && ob->pd->deflect) { + /* if (md && ob->pd && ob->pd->deflect) { */ + /* no reason for that any more BM */ + if (0) { md->mode &= ~(eModifierMode_Realtime|eModifierMode_Render|eModifierMode_Editmode); md = NULL; } diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 30817c10355..4595243bd45 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1417,7 +1417,9 @@ static void object_panel_deflectors(Object *ob) uiDefButF(block, NUM, B_DIFF, "Inner:", 160,20,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); uiDefButF(block, NUM, B_DIFF, "Outer:", 160, 0,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); uiBlockBeginAlign(block); +/* seems to be working fine .. so we do use modifier stack by default .. code here rests for debugging uiDefButBitS(block, TOG, PDEFLE_DEFORM , 0,"UMS or CRASH", 0,0,150,20, &pd->flag, 0, 0, 0, 0, "Let collision object move with armatures/lattices WARNING logical circles will CRASH"); +*/ } } } @@ -1464,7 +1466,9 @@ static void object_softbodies(Object *ob) if(uiNewPanel(curarea, block, "Softbody", "Object", 640, 0, 318, 204)==0) return; /* do not allow to combine with force fields */ - if(ob->pd && ob->pd->deflect) { + /* if(ob->pd && ob->pd->deflect) { */ + /* no reason for that any more BM */ + if(0) { uiDefBut(block, LABEL, 0, "Object has Deflection,", 10,160,300,20, NULL, 0.0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, "no Softbody possible", 10,140,300,20, NULL, 0.0, 0, 0, 0, ""); } else { |