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:
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:
Then, in the Begin Play event, we call the relevant functions to declare the predicates, and then initialize the deformable mesh:
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.