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.

  3. Press Edit Particles in the inspector to edit particles in the Scene view.

    Instructions

    • Left click: make particles kinematic.

    • Shift + left click: make particles non-kinematic.

    • Alt + drag: marquee-select particles and make them kinematic.

    • Shift + Alt + drag: marquee-select particles and make them non-kinematic.

    Particle Ledger

    • Red: kinematic.

    • Green: non-kinematic.

    • Blue: selected.

    Configuration Settings

    • Particle scale: How big particles are, helping with the visualization.

    • Particle count: How many particles show. Restricting the number of particles shown can help with performance when editing large meshes.

    ../../../_images/ledger.png

    Marquee Selection can help you select multiple particles at once. You can hold the Alt key and drag to marquee-select particles and make them kinematic, or hold Shift + Alt and drag to marquee-select particles and make them non-kinematic.

    ../../../_images/kinematic_marqee.gif
  4. 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