Dirk Gregorius wrote:So you solve the rigid bodies and the particles in two different loops and only in the particle loop you apply impulse derived from the particle displacements? Did you try to solve both in the same loop, e.g.
The final sweep would adjust positions for the particles and apply impulses on the rigid bodies derived from the particle correction.
Since you mention the Muller paper. For the soft bodies you simply use tetrahedral meshes with volume preserving constraints and distance constraints between the nodes? Basically:
C(p1, p2) = |p2 p1|- L0 = 0
C(p1, p2, p3, p4) = |(p2 - p1) * (p3 - p1) x (p4 - p1)| / 6 - V0 = 0
Yes i rigid and soft bodies are solved in two different loops, i didn't try to solve them in the same loop because I'm sure it will work much better
but that create a coupling between the two that I'd like to dodge. just few of my rationals:
- Iterations number for rigid simulation should, in an ideal world be set to +inf, because we want to solve the system, but in soft bodies, it's more a parameter of the system, that can vary from bodies to bodies for 'aesthetic' reasons.
- Almost by definition, soft bodies create 'soft' constraints on rigid bodies, it should be possible to get nice results using only impulses outside the loop (at least i try to).
- Code/architecture, i don't know or maintain the rigid simulation of Bullet, and peoples who do surely don't want to have include the soft bodies part each time a change occur or new ideas are tested for rigid bodies. That's a trade off between accuracy and simplicity.
For volume, three different methods are demonstrated,
- the demo named 'Pressure' use forces, as describe in 'Pressure soft bodies model' from Maciej Matyka.
- the demo named 'Volume' uses forces proportional to (V-V0)*area per vertex in the direction of the normal, there is no tetrahedrons involved, just global volume.
- the demos named 'TorusMatch' and 'BunnyMatch' use polar decomposition to extract linear transforms (just rotation for the moment) from the deformed model, and 'pulling' vertices's toward the reference shape, see 'shape matching' from Matthias Muller (him again
). Still no tetrahedron.
The reason i don't make use tetrahedrons is twofold, first, authoring, i don't know of any commonly available 3d package that output tetrahedral meshes, second, the three previously mentioned methods work well for volume conservation, and i have ideas to 'emulate' finite elements (for plasticity and fracture, the next step after volume conservation) using the properties of polar decomposition.
Nat.