Beispiel #1
0
        public static KDTree2D ByUVsAndObjects(UV[] uvs, object[] objects)
        {
            var t = new KDTree2D();

            t.hasObjects = true;

            var points = new List <double[]>();

            foreach (var uv in uvs)
            {
                points.Add(new double[] { uv.U, uv.V });
            }

            t._Impl = new KDTreeImpl(2, points.ToArray(), objects, DistanceSquared);

            return(t);
        }
Beispiel #2
0
        public static KDTree2D ByUVs(UV[] uvs)
        {
            var t = new KDTree2D();

            var points = new List <double[]>();

            foreach (var uv in uvs)
            {
                points.Add(new double[] { uv.U, uv.V });
            }

            var objects = new List <object>();

            objects.AddRange(System.Linq.Enumerable.Repeat <object>(null, points.Count));

            t._Impl = new KDTreeImpl(2, points.ToArray(), objects.ToArray(), DistanceSquared);

            return(t);
        }