Example #1
0
        private void calculateCenter()
        {
            MeshData mesh;
            MinMax   min_max = MinMax.init;
            int      mesh_index, vertex;

            for (mesh_index = meshes.Count - 1; mesh_index >= 0; --mesh_index)
            {
                for (mesh = meshes[mesh_index],
                     vertex = null == (object)mesh ? -1 : (mesh.vertices.Length - 1);
                     vertex >= 0; --vertex)
                {
                    min_max.Integrate(ref mesh.vertices[vertex]);
                }
            }

            min_max.Fallback();

            center = min_max.center;
            upper  = min_max.max;
            lower  = min_max.min;
        }