Panda3D Manual: Bullet Softbody PatchSoft body patches are two-dimensional rectangular meshes, which can be used to simulate for example a flag, a tapestry, or sheets of paper.
SetupSetting up a soft body patch is similar to soft body ropes, but a few extra settings have to be done. The following code will create rectangular path with 31 by 31 segments, and thus 32 x 32 nodes. TODO First we have to configure the soft body world properties, like we did for soft body ropes too. Next we define variables for the resolution in x- and y-direction, and for the four corner points of the patch. The variable fixeds is set to the value 1+2+4+8=15, meaning that the patch should be attached to the world on all four corners. To attach it to the first and third corner (diagonal) we would set the value to 1+8=9, and to not attach it at all we would set it to 0. Now we can create the soft body node using the factory method
VisualisationIn order to have a visual representation of the soft body patch we need a TODO The third parameter to So far the generated geometry has no texture and no texture coordinates.
But the texture has already a column for texcoords, so we just need to write texcoords using a TODO Note:
It is also possible to render soft body patches using a © Carnegie Mellon University 2010 |