Deformation Component

Any Static Mesh Component can be modified by the CTD algorithms, using the Mages Deformation component. This provides a unified access method to the mesh data, so that they may be updated in a simple and fast manner.

Creating a Deformable Mesh

To create a deformable mesh from a static mesh component, add the deformation component under the static mesh:

../../../_images/deform00.png

Mesh Predicates

The whole mesh has now been converted into a deformable mesh, and can have ctd operations applied on to it. For optimization purposes, we can choose to split the mesh in multiple sections according to our predicate system. This can be done by adding shapes (spheres, boxes, capsules) and using them to construct the mesh.

As an example, we’ll use one predicate (a Sphere Collision component) to separate the mesh into two sections.

First, we add the predicate to the mesh, as shown below:

../../../_images/deform01.png

Then, in the Begin Play event, we call the relevant functions to declare the predicates, and then initialize the deformable mesh:

../../../_images/deform02.png

Warning

If you are using predicates, make sure to turn off “Initialize on Begin Play” in the Mages Deformation component properties.

If we’ve checked “Enable Debug” on the Mages Deformation component, the we can see that the new mesh section we’ve defined has black rectangles on its vertices.

../../../_images/deform03.png