25-11-2023, 08:18 PM
(This post was last modified: 26-11-2023, 11:57 AM by josemendez.)
(25-11-2023, 03:06 PM)KBTIT_ Wrote: I cannot change the TransForm of an OBi SoftBody if the Shape Matching Constraints of the OBi SoftBody is enabled.
Hi,
You can't change the transform of a softbody, or any deformable object for that matter. Due to their mathematical nature transforms only work on rigid objects: a transform specifies a single position/rotation/scale, but on a deformable object all of its parts can be at different positions/rotations/sizes so using a single transform on the entire object doesn't make any sense.
(25-11-2023, 03:06 PM)KBTIT_ Wrote: I don't see anything in the documentation about that...
Transforms are a part of Unity, and this is the usual behavior of transforms in all kinds of 3d software. As such, it is not mentioned in Obi's documentation since it is a basic concept in 3d. Transforms behave the same way with Unity's own deformable objects such as cloth or particles, and in all other existing 3d software (Blender, Maya, 3dsMax, etc): changing the transform either has no effect on the deformable object, or it is impossible to change it.
(25-11-2023, 03:06 PM)KBTIT_ Wrote: However, if Shape Matching Constraints is not enabled, you cannot change that parameter. How can I change TransForm while Shape Matching Constraints is enabled?
Depending on what your specific goal is, you can:
- Rigidly attach some particles to a transform using a static attachment, then move the transform. This will move the attached particles, and all other particles in the softbody will follow due to physics. You can see an example of this in the included "RubberDragon" sample scene, the bottom part of the dragon is attached to a transform and will follow it.
- Teleport the softbody to a new location using softbody.Teleport(); This will instantly move all particles in the softbody to a new position/rotation, using the body center of mass as the pivot point.
- Move individual particles around using the particles API
- Use the solver transform, which will translate/rotate/scale the entire simulation space and all actors (such as softbodies) contained in it. This is because simulation takes place in the solver’s local space, as explained in the manual.
(25-11-2023, 03:06 PM)KBTIT_ Wrote: What are Shape Matching Constraints anyway?
Obi is a particle-based engine, where particles are linked to each other using constraints:
http://obi.virtualmethodstudio.com/manua...index.html
Quote:Obi is a collection of particle-based physics plugins for Unity. Everything in Obi is made out of small spheres called particles. Particles can interact with each other, affect and be affected by other objects trough the the use of constraints.
Shape matching constraints are a specific type of constraint that groups multiple particles in what's called a "cluster", allowing them to move together giving rise to softbody deformation.
http://obi.virtualmethodstudio.com/manua...aints.html
Quote:Shape matching constraints link a group of particles together and try to keep them in the same position and orientation relative to each other, while allowing the group as a whole to rotate and translate freely. Each individual group of particles is generally referred to as a "cluster". Multiple clusters can overlap, and the particles shared between them will try to minimize deformation for all clusters they're involved with. This mechanism is used to allow some degree of deformation in softbodies.
You can find a detailed explanation of how the engine works in the manual, along with a comprehensive list of all constraint types besides shape matching:
http://obi.virtualmethodstudio.com/manua...gence.html
Shape matching is a very common rigid and softbody simulation technique in all kinds of software (the other most common method being FEM). If you're interested in some more techical info here's some documents/videos explaining shape matching in detail:
https://graphics.stanford.edu/courses/cs...muller.pdf
https://matthias-research.github.io/page...ticles.pdf
https://mmacklin.com/uppfrta_preprint.pdf
https://youtu.be/3OmkehAJoyo?feature=shared&t=563
Many other softbody simulation software uses shape matching constraints, a couple examples:
https://www.sidefx.com/docs/houdini/vell...ching.html
https://grasshopperdocs.com/components/f...raint.html