Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find out which particle group to attach with the ObiParticleAttachment
#4
(10-08-2021, 07:16 PM)snowtv Wrote: Thanks for the answer. If I don't want to go through the hassle of creating many particle groups, is it possible to create an ObiParticleAttachment that only attaches one particle to the designated object?

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.

(10-08-2021, 07:16 PM)snowtv Wrote: Or maybe there is another class for attaching a single soft body particle to another object?

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.

(10-08-2021, 07:16 PM)snowtv Wrote: I have another question, is it possible to read the total force that's currently applied on a soft body particle from its surrounding particles? You are using your own physics engine so I'm assuming I can?

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.
Reply


Messages In This Thread
RE: Find out which particle group to attach with the ObiParticleAttachment - by josemendez - 11-08-2021, 11:33 AM