Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What can I adjust to stop a cloth from doing through a collision mesh?
#12
yes I am stitching at runtime.

this is the stitching code:
Code:
            // Sew all sides together:
            ObiStitcher stitcher = gameObject.AddComponent<ObiStitcher>();
            stitcher.Actor1 = cloths[0];
            stitcher.Actor2 = cloths[1];

            //Add stitches:
            var stencilData = stencil.Generate();
            foreach (ShapeData shapeData in stencilData)
            {
                foreach (CurveData curveData in shapeData)
                {
                    if (curveData.Stitched)
                    {
                        int[][] stitches = new int[2][];

                        for (int i = 0; i < meshData.Length; i++)
                        {
                            stitches[i] = meshData[i].VerticesOnCurve(curveData);
                        }

                        for (int i = 0; i < stitches[0].Length; i++)
                        {
                            Debug.Log(stitches[1].Length);
                            stitcher.AddStitch(stitches[0][i], stitches[1][i]);
                        }
                    }
                }
            }

            stitcher.PushDataToSolver();

            cloths[0].maxBending = 0.1f;

            cloths[1].maxBending = 0.1f;
its pretty much pairing up vertices that exist on the same stitched curve on different meshes.

could it be the mesh im generating before stitching causing problems? like its too tight?
Reply


Messages In This Thread
RE: What can I adjust to stop a cloth from doing through a collision mesh? - by MoonBoop - 29-01-2022, 01:13 PM