Dynamic Softbody Actor

Unlike Softbody, Dynamic Softbody uses a dynamic simulation mesh. By dynamic, we mean that the simulation mesh can be modified at runtime, by adding or removing particles and constraints. This is useful for creating objects that can be cut or torn in realtime.

In order to create a Dynamic Softbody you need to:

  1. Create a Simulation Mesh from the tetrahedral mesh.

    While creating the simulation mesh from the source tetrahedral mesh with the tool described here, you must set the Distance Constraints Generate and Volume Constraints Generate properties to OnePerEdge and OnePerTetrahedron, and the Shape Matching Constraints Generate property to DontGenerate. This will create a simulation mesh with only Distance and Volume constraints, which is suitable for simulating a soft, deformable object.

    Note

    If you want the object to be tearable, select the tearable option in the submesh options of the converter tool.

  2. Create a DynamicSoftbodyActor and assign the Simulation Mesh.

    Create an empty GameObject and add a DynamicSoftbodyActor component to it by clicking Add Component > MAGES > Mesh Deformations > Actors > Dynamic Softbody Actor in the inspector

    ../../../_images/AddComponentDynamicSoftbodyActor.PNG

    Assign the Simulation Mesh and a Physics World to the DynamicSoftbodyActor component

    ../../../_images/DynamicSoftbodyActorInspector.PNG

    When using the object with Cut/Tear we recommend enabling the Remove Residual Distance Constraints and RemoveVolumeConstraintsWithLimitedNeighbors options. Also the MinimumNumberOfNeighborsBeforeRemoval is recommended to be set to 2. These options will help to remove the constraints that are not needed anymore and reduce visual artifacts while cutting/tearing.

    Note

    You can edit the kinematic particles using the editing tool, by pressing the ‘Edit Particles’ button in the inspector.

    ../../../_images/edit-particles.PNG

    In the particles that appear on the scene, left click to make them kinematic (red color) and shift + left click to make them dynamic (green color).

  3. Render the Dynamic Softbody.

    The mesh of the Dynamic softbody is generated based on the current outer surface of the simulation mesh. To render it, you must add a MeshRenderer component to the GameObject and assign Materials to it.

    Additionally, to map UVs from a surface mesh to the auto generated mesh you can click on the Import UVs from Existing Mesh button in the inspector and select the source mesh:

    ../../../_images/import-uvs.PNG