Ejemplo n.º 1
0
        /// <summary>
        /// Given a number of lengths, returns the maximum CacheDensity
        /// </summary>
        /// <param name="density">density value</param>
        /// <param name="pathlengths"></param>
        public static int CalculateSamplePointsCacheSize(int density, params float[] pathlengths)
        {
            density = Mathf.Clamp(density, 0, 100);
            int size = 0;

            for (int i = 0; i < pathlengths.Length; i++)
            {
                size = Mathf.Max(size, CurvySpline.CalculateCacheSize(density, pathlengths[i], CurvyGlobalManager.MaxCachePPU));
            }

            return(size);
        }