Beispiel #1
0
        // Crumbling
        public static void SizeCollapse(RayfireConnectivity connectivity, float sizeValue)
        {
            // Value lower than last
            if (sizeValue < connectivity.cluster.sizeCollapse)
            {
                return;
            }

            // Set value
            connectivity.cluster.sizeCollapse = sizeValue;

            // Main cluster.
            int removed = RemNeibBySize(connectivity.cluster, sizeValue);;

            if (removed > 0)
            {
                connectivity.CheckConnectivity();
            }
        }
Beispiel #2
0
        // Crumbling
        public static void AreaCollapse(RayfireConnectivity connectivity, float areaValue)
        {
            // Value lower than last
            if (areaValue < connectivity.cluster.areaCollapse)
            {
                return;
            }

            // Set value
            connectivity.cluster.areaCollapse = areaValue;

            // Main cluster.
            int removed = RemNeibByArea(connectivity.cluster, areaValue);;

            if (removed > 0)
            {
                connectivity.CheckConnectivity();
            }
        }
Beispiel #3
0
        // Crumbling
        public static void RandomCollapse(RayfireConnectivity connectivity, int randomPercentage, int seedValue)
        {
            // Clamp
            randomPercentage = Mathf.Clamp(randomPercentage, 0, 100);

            // Value lower than last
            if (randomPercentage < connectivity.cluster.randomCollapse)
            {
                return;
            }

            // Set value
            connectivity.cluster.randomCollapse = randomPercentage;
            connectivity.cluster.randomSeed     = seedValue;

            // Main cluster.
            int removed = RemNeibRandom(connectivity.cluster, randomPercentage, seedValue);

            if (removed > 0)
            {
                connectivity.CheckConnectivity();
            }
        }