19-02-2021, 03:52 PM
(This post was last modified: 19-02-2021, 03:53 PM by orestissar.)
Hey again,
ok first of all i created 2 lists with the particle positions of each flag which is working.
Then tried couple ways to compare.
and
Both the above returned the correct value of the list length (289 because the 2 flags have 17x17 vertices) only when the 2 flags were 100% on the same position.
ok first of all i created 2 lists with the particle positions of each flag which is working.
Code:
for (int i = 0; i <= 288; i++)
{
clothParticles1.Add(cloth1.GetParticlePosition(cloth1.solverIndices[i]));
clothParticles2.Add(cloth2.GetParticlePosition(cloth2.solverIndices[i]));
}
Code:
foreach (Vector3 i in clothParticles1)
{
if (clothParticles2.Contains(i))
{
stitchlist.Add(i);
}
}
Code:
List<Vector3> stitchlist = new List<Vector3>(clothParticles1.Intersect(clothParticles2));
Both the above returned the correct value of the list length (289 because the 2 flags have 17x17 vertices) only when the 2 flags were 100% on the same position.