Beispiel #1
0
 public static void CalculateInterpolatedLightAndOcclusionProbes(List <Vector3> positions, List <SphericalHarmonicsL2> lightProbes, List <Vector4> occlusionProbes)
 {
     if (positions == null)
     {
         throw new ArgumentNullException("positions");
     }
     if (lightProbes == null && occlusionProbes == null)
     {
         throw new ArgumentException("Argument lightProbes and occlusionProbes cannot both be null.");
     }
     if (lightProbes != null)
     {
         if (lightProbes.Capacity < positions.Count)
         {
             lightProbes.Capacity = positions.Count;
         }
         if (lightProbes.Count < positions.Count)
         {
             NoAllocHelpers.ResizeList <SphericalHarmonicsL2>(lightProbes, positions.Count);
         }
     }
     if (occlusionProbes != null)
     {
         if (occlusionProbes.Capacity < positions.Count)
         {
             occlusionProbes.Capacity = positions.Count;
         }
         if (occlusionProbes.Count < positions.Count)
         {
             NoAllocHelpers.ResizeList <Vector4>(occlusionProbes, positions.Count);
         }
     }
     LightProbes.Internal_CalculateInterpolatedLightAndOcclusionProbes(NoAllocHelpers.ExtractArrayFromListT <Vector3>(positions), positions.Count, NoAllocHelpers.ExtractArrayFromListT <SphericalHarmonicsL2>(lightProbes), NoAllocHelpers.ExtractArrayFromListT <Vector4>(occlusionProbes));
 }
Beispiel #2
0
 private void PrepareUserBuffer <T>(List <T> buffer, int capacity)
 {
     buffer.Clear();
     if (buffer.Capacity < capacity)
     {
         buffer.Capacity = capacity;
     }
     NoAllocHelpers.ResizeList(buffer, capacity);
 }
Beispiel #3
0
 public static void EnsureListElemCount <T>(List <T> list, int count)
 {
     list.Clear();
     if (list.Capacity < count)
     {
         list.Capacity = count;
     }
     NoAllocHelpers.ResizeList <T>(list, count);
 }
Beispiel #4
0
        public static void CalculateInterpolatedLightAndOcclusionProbes(List <Vector3> positions, List <SphericalHarmonicsL2> lightProbes, List <Vector4> occlusionProbes)
        {
            bool flag = positions == null;

            if (flag)
            {
                throw new ArgumentNullException("positions");
            }
            bool flag2 = lightProbes == null && occlusionProbes == null;

            if (flag2)
            {
                throw new ArgumentException("Argument lightProbes and occlusionProbes cannot both be null.");
            }
            bool flag3 = lightProbes != null;

            if (flag3)
            {
                bool flag4 = lightProbes.Capacity < positions.Count;
                if (flag4)
                {
                    lightProbes.Capacity = positions.Count;
                }
                bool flag5 = lightProbes.Count < positions.Count;
                if (flag5)
                {
                    NoAllocHelpers.ResizeList <SphericalHarmonicsL2>(lightProbes, positions.Count);
                }
            }
            bool flag6 = occlusionProbes != null;

            if (flag6)
            {
                bool flag7 = occlusionProbes.Capacity < positions.Count;
                if (flag7)
                {
                    occlusionProbes.Capacity = positions.Count;
                }
                bool flag8 = occlusionProbes.Count < positions.Count;
                if (flag8)
                {
                    NoAllocHelpers.ResizeList <Vector4>(occlusionProbes, positions.Count);
                }
            }
            LightProbes.CalculateInterpolatedLightAndOcclusionProbes_Internal(NoAllocHelpers.ExtractArrayFromListT <Vector3>(positions), positions.Count, NoAllocHelpers.ExtractArrayFromListT <SphericalHarmonicsL2>(lightProbes), NoAllocHelpers.ExtractArrayFromListT <Vector4>(occlusionProbes));
        }