Tetrahedralize() private méthode

private Tetrahedralize ( Vector3 positions, int &outIndices, Vector3 &outPositions ) : void
positions Vector3
outIndices int
outPositions Vector3
Résultat void
 public static void TetrahedralizeSceneProbes(out Vector3[] positions, out int[] indices)
 {
     LightProbeGroup[] objectsOfType = UnityEngine.Object.FindObjectsOfType(typeof(LightProbeGroup)) as LightProbeGroup[];
     if (objectsOfType == null)
     {
         positions = new Vector3[0];
         indices   = new int[0];
     }
     else
     {
         List <Vector3> vector3List = new List <Vector3>();
         foreach (LightProbeGroup lightProbeGroup in objectsOfType)
         {
             foreach (Vector3 probePosition in lightProbeGroup.probePositions)
             {
                 Vector3 vector3 = lightProbeGroup.transform.TransformPoint(probePosition);
                 vector3List.Add(vector3);
             }
         }
         if (vector3List.Count == 0)
         {
             positions = new Vector3[0];
             indices   = new int[0];
         }
         else
         {
             Lightmapping.Tetrahedralize(vector3List.ToArray(), out indices, out positions);
         }
     }
 }
Exemple #2
0
        public static void TetrahedralizeSceneProbes(out Vector3[] positions, out int[] indices)
        {
            var probeGroups = Object.FindObjectsOfType(typeof(LightProbeGroup)) as LightProbeGroup[];

            if (probeGroups == null)
            {
                positions = new Vector3[0];
                indices   = new int[0];
                return;
            }
            var probePositions = new List <Vector3>();

            foreach (var group in probeGroups)
            {
                var localPositions = group.probePositions;
                foreach (var position in localPositions)
                {
                    var wPosition = group.transform.TransformPoint(position);
                    probePositions.Add(wPosition);
                }
            }

            if (probePositions.Count == 0)
            {
                positions = new Vector3[0];
                indices   = new int[0];
                return;
            }

            Lightmapping.Tetrahedralize(probePositions.ToArray(), out indices, out positions);
        }
 public static void TetrahedralizeSceneProbes(out Vector3[] positions, out int[] indices)
 {
     LightProbeGroup[] array = UnityEngine.Object.FindObjectsOfType(typeof(LightProbeGroup)) as LightProbeGroup[];
     if (array == null)
     {
         positions = new Vector3[0];
         indices   = new int[0];
     }
     else
     {
         List <Vector3>    list   = new List <Vector3>();
         LightProbeGroup[] array2 = array;
         for (int i = 0; i < array2.Length; i++)
         {
             LightProbeGroup lightProbeGroup = array2[i];
             Vector3[]       probePositions  = lightProbeGroup.probePositions;
             Vector3[]       array3          = probePositions;
             for (int j = 0; j < array3.Length; j++)
             {
                 Vector3 position = array3[j];
                 Vector3 item     = lightProbeGroup.transform.TransformPoint(position);
                 list.Add(item);
             }
         }
         if (list.Count == 0)
         {
             positions = new Vector3[0];
             indices   = new int[0];
         }
         else
         {
             Lightmapping.Tetrahedralize(list.ToArray(), out indices, out positions);
         }
     }
 }