Exemple #1
0
        private HashSet <SoftBody.Edge> GetEdges(List <TriangleVertexIndices> indices)
        {
            HashSet <SoftBody.Edge> hashSet = new HashSet <SoftBody.Edge>();

            for (int i = 0; i < indices.Count; i++)
            {
                SoftBody.Edge item = new SoftBody.Edge(indices[i].I0, indices[i].I1);
                bool          flag = !hashSet.Contains(item);
                if (flag)
                {
                    hashSet.Add(item);
                }
                item = new SoftBody.Edge(indices[i].I1, indices[i].I2);
                bool flag2 = !hashSet.Contains(item);
                if (flag2)
                {
                    hashSet.Add(item);
                }
                item = new SoftBody.Edge(indices[i].I2, indices[i].I0);
                bool flag3 = !hashSet.Contains(item);
                if (flag3)
                {
                    hashSet.Add(item);
                }
            }
            return(hashSet);
        }
Exemple #2
0
 public override bool Equals(object obj)
 {
     SoftBody.Edge edge = (SoftBody.Edge)obj;
     return((edge.Index1 == this.Index1 && edge.Index2 == this.Index2) || (edge.Index1 == this.Index2 && edge.Index2 == this.Index1));
 }