コード例 #1
0
ファイル: ObiRope.cs プロジェクト: usernameHed/BackHome
        /**
         * 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);
        }
コード例 #2
0
        /**
         * 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);
        }
コード例 #3
0
 public virtual bool GenerateTethers(TetherType type)
 {
     return(true);
 }