/** * Automatically generates tether constraints for the cloth. * Partitions fixed particles into "islands", then generates up to maxTethers constraints for each * particle, linking it to the closest point in each island. */ public override bool GenerateTethers(TetherType type) { if (!Initialized) { return(false); } TetherConstraints.Clear(); if (type == TetherType.Hierarchical) { GenerateHierarchicalTethers(5); } else { GenerateFixedTethers(2); } return(true); }
/** * Automatically generates tether constraints for the cloth. * Partitions fixed particles into "islands", then generates up to maxTethers constraints for each * particle, linking it to the closest point in each island. */ public override bool GenerateTethers(TetherType type) { if (!Initialized) { return(false); } TetherConstraints.Clear(); // generate disjoint islands: List <HashSet <int> > islands = GenerateIslands(System.Linq.Enumerable.Range(0, topology.heVertices.Length), false); // generate tethers for each one: foreach (HashSet <int> island in islands) { GenerateTethersForIsland(island, 4); } return(true); }
public virtual bool GenerateTethers(TetherType type) { return(true); }