Deformable Mesh

Using Geometric Algebra [D1], several mesh deformations are supported for skinned and non-skinned meshes alike.

Setting up a deformable mesh

To convert a mesh into a deformable mesh, attach the “Deformable Mesh” component on the Game Object that contains its renderer.

../../../_images/ctd_deformable_00.jpg

The deformable mesh can be separated into multiple sections, based on what parts of it may be changed, as well as for optimization purposes. To separate a mesh, a list of predicates is used, which are gameobject hierarchies that contain colliders:

../../../_images/ctd_deformable_01.jpg

You can add predicates by adding to the “Predicates” property in the Deformable Mesh component:

../../../_images/ctd_deformable_02.jpg

After adding the colliders, you can convert the mesh to a deformable mesh, by clicking on the “Separate Mesh” button. This may take a few moments, based on the complexity of the mesh in question:

../../../_images/ctd_deformable_03.jpg

In this case, since we used, 2 predicates, there are a total of 3 different mesh sections:

  • The original mesh

  • And the two separated sections from the vertices that were inside the sphere colliders

In the sections list, you can check the property “Can Modify” to disable modification of the mesh section in question by all CTD scripts.

Finally, in order to be able to save the deformable mesh as a prefab select a valid path and name in the fields shown below and click Save Sections.

../../../_images/SaveDeformableMesh.jpg

Then you can simply parent all the deformable mesh’s components in an empty gameobject and drag n drop it in your assets to create a reusable prefab.


References

D1

Kamarianakis, M., Lydatakis, N., Protopsaltis, A., Petropoulos, J., Tamiolakis, M., Zikas, P., & Papagiannakis, G. (2021). ” Deep Cut”: An all-in-one Geometric Algorithm for Unconstrained Cut, Tear and Drill of Soft-bodies in Mobile VR. arXiv preprint arXiv:2108.05281.