11-08-2021, 07:57 PM
(11-08-2021, 11:33 AM)josemendez Wrote: Attachments work on particle groups, they can't work on individual particles. This being said, creating one particle group per particle is a perfectly valid approach. You can do this programmatically if you don't want to do it by hand in the editor.
There's at least two other ways to attach particles: set their inverseMass to zero (disables dynamics) and then set their position to whatever value you desire:
http://obi.virtualmethodstudio.com/manua...icles.html
or add pin constraints:
http://obi.virtualmethodstudio.com/manua...aints.html
See for instance the sample /Obi/Scripts/Common/Utils/ObiContactGrabber.cs script: it uses the first approach to attach particles to objects they collide with.
Obi is a position-based engine, so internally no forces are used. Shape-matching in particular (the algorithm used for softbody simulation) works with deformation tensors. Each particle and its close neighbors are considered a shape-matching cluster, the algorithm strives to keep the rotationally invariant shape of each of these clusters during simulation. The deformation for each cluster is stored as a 3x3 matrix. For more info: https://matthias-research.github.io/page...ticles.pdf
You can get the 3x3 deformation matrix for each shape matching cluster, and use its trace as a scalar measure of deformation. See the included "DeformationGradient" sample scene: it maps deformation to a vertex color gradient for visualization.
Sounds great, I'll try those out!