Exemplo n.º 1
0
        public static List <Vector2> BuildHull(List <Vector2> points, float scale = 10)
        {
            JarvisConvex jarvis = new JarvisConvex();

            foreach (Vector2 p in points)
            {
                jarvis.AddPoint(p * scale);
            }
            return(jarvis.Calculate(scale));
        }
Exemplo n.º 2
0
        public static List <Vector2> BuildHullIndex(List <Vector2> points, out List <int> resultIndex, float scale = 10)
        {
            JarvisConvex jarvis = new JarvisConvex();

            foreach (Vector2 p in points)
            {
                jarvis.AddPoint(p * scale);
            }
            var ps = jarvis.Calculate(scale);

            resultIndex = jarvis.mResultIndex;
            return(ps);
        }